filesystem for golang

Overview

filesystem

filesystem for golang

installation

go get github.com/go-component/filesystem

import

import "github.com/go-component/filesystem"

Usage

support single or multiple for file operation


// single
Mkdir("a", 0755)

// multiple

Mkdir([]string{"a", "b"}, 0755)


More Usage

func AppendToFile

func AppendToFile(fileName string, content []byte) error

Appends content to a file.

func Chmod

func Chmod(files interface{}, mode os.FileMode) error

Change mode for an array of files or directories.

func ChmodWithRecur

func ChmodWithRecur(files interface{}, mode os.FileMode) error

Change mode for an array of files or directories with recursive mode.

func Chown

func Chown(files interface{}, user, group int) error

Change the owner of an array of files or directories.

func ChownWithRecur

func ChownWithRecur(files interface{}, user, group int) error

Change the owner of an array of files or directories recursive mode.

func Copy

func Copy(srcFileName string, dstFileName string) error

Copies a file.

func Dirname

func Dirname(fileName string) string

Return dirname.

func Exists

func Exists(paths interface{}) bool

Checks the existence of files or directories.

func Hardlink

func Hardlink(srcFileName string, dstFileName string) error

Creates a hard link, or several hard links to files.

func IsAbsolutePath

func IsAbsolutePath(fileName string) bool

Return whether the file path is an absolute path.

func IsDir

func IsDir(path string) bool

Returns whether the file path is a directory.

func IsFile

func IsFile(path string) bool

Returns whether the file path is a file.

func IsReadable

func IsReadable(fileName string) bool

Tells whether a file exists and is readable.

func IsWritable

func IsWritable(fileName string) bool

Tells whether a file exists and is writable.

func Mkdir

func Mkdir(paths interface{}, mode os.FileMode) error

Creates a directory of directory or directories.

func Readlink

func Readlink(path string) (string, error)

Resolves links in paths.

func Remove

func Remove(files interface{}) error

Remove removes the named file or (empty) directory.

func RemoveWithRecur

func RemoveWithRecur(files interface{}) error

Remove removes the named file or directory with recursive mode.

func Rename

func Rename(srcFileName string, dstFileName string) error

Rename src to dst.

func ResolveFilesAndDirs

func ResolveFilesAndDirs(dirPath string) (files []string, dirs []string, err error)

Resolves files and directories.

func Symlink

func Symlink(srcDirName string, dstDirName string) error

Creates a symbolic link or copy a directory.

func Touch

func Touch(files interface{}) error

Creates new files if not exist.

func TouchFromTime

func TouchFromTime(files interface{}, atime time.Time, mtime time.Time) error

Sets access and modification time of files.

Releases(v1.0.0)
A FileSystem Abstraction System for Go

A FileSystem Abstraction System for Go Overview Afero is a filesystem framework providing a simple, uniform and universal API interacting with any fil

Steve Francia 4.4k May 17, 2022
A package to allow one to concurrently go through a filesystem with ease

skywalker Skywalker is a package to allow one to concurrently go through a filesystem with ease. Features Concurrency BlackList filtering WhiteList fi

Will Dixon 79 May 6, 2022
An implementation of the FileSystem interface for tar files.

TarFS A wrapper around tar.Reader. Implements the FileSystem interface for tar files. Adds an Open method, that enables reading of file according to i

Eyal Posener 50 May 17, 2022
Takes an input http.FileSystem (likely at go generate time) and generates Go code that statically implements it.

vfsgen Package vfsgen takes an http.FileSystem (likely at go generate time) and generates Go code that statically implements the provided http.FileSys

null 943 Apr 29, 2022
memfs: A simple in-memory io/fs.FS filesystem

memfs: A simple in-memory io/fs.FS filesystem memfs is an in-memory implementation of Go's io/fs.FS interface. The goal is to make it easy and quick t

Peter Sanford 60 May 21, 2022
A Go io/fs filesystem implementation for reading files in a Github gists.

GistFS GistFS is an io/fs implementation that enables to read files stored in a given Gist. Requirements This module depends on io/fs which is only av

Jean Hadrien Chabran 124 May 1, 2022
A Small Virtual Filesystem in Go

This is a virtual filesystem I'm coding to teach myself Go in a fun way. I'm documenting it with a collection of Medium posts that you can find here.

Alyson 31 Apr 18, 2022
CRFS: Container Registry Filesystem

CRFS: Container Registry Filesystem Discussion: https://github.com/golang/go/issues/30829 Overview CRFS is a read-only FUSE filesystem that lets you m

Google 1.2k May 19, 2022
Encrypted overlay filesystem written in Go

An encrypted overlay filesystem written in Go. Official website: https://nuetzlich.net/gocryptfs (markdown source). gocryptfs is built on top the exce

null 2.3k May 20, 2022
Go filesystem implementations for various URL schemes

hairyhenderson/go-fsimpl This module contains a collection of Go filesystem implementations that can discovered dynamically by URL scheme. All filesys

Dave Henderson 223 May 14, 2022
A Go filesystem package for working with files and directories

Stowage A Go filesystem package for working with files and directories, it features a simple API with support for the common files and directories ope

null 19 May 28, 2021
A set of io/fs filesystem abstractions and utilities for Go

A set of io/fs filesystem abstractions and utilities for Go Please ⭐ this project Overview This package provides io/fs interfaces for: Cloud providers

null 8 Mar 24, 2022
Tarserv serves streaming tar files from filesystem snapshots.

tarserv A collection of tools that allow serving large datasets from local filesystem snapshots. It is meant for serving big amounts of data to shell

Aurora 1 Jan 11, 2022
Grep archive search in any files on the filesystem, in archive and even inner archive.

grep-archive Grep archive search for string in any files on the filesystem, in archive and even inner archive. Supported archive format are : Tar Form

Michel Prunet 0 Jan 26, 2022
Golang wrapper for Exiftool : extract as much metadata as possible (EXIF, ...) from files (pictures, pdf, office documents, ...)

go-exiftool go-exiftool is a golang library that wraps ExifTool. ExifTool's purpose is to extract as much metadata as possible (EXIF, IPTC, XMP, GPS,

null 112 May 16, 2022
Load GTFS files in golang

go-gtfs Load GTFS files in Go. The project is in maintenance mode. It is kept compatible with changes in the Go ecosystem but no new features will be

Louis 32 Mar 5, 2022
Golang PDF library for creating and processing PDF files (pure go)

UniPDF - PDF for Go UniDoc UniPDF is a PDF library for Go (golang) with capabilities for creating and reading, processing PDF files. The library is wr

UniDoc 1.6k May 14, 2022
The best HTTP Static File Server, write with golang+vue

gohttpserver Goal: Make the best HTTP File Server. Features: Human-friendly UI, file uploading support, direct QR-code generation for Apple & Android

Sound Sun 1.6k May 19, 2022
Go (golang) library for reading and writing XLSX files.

XLSX Introduction xlsx is a library to simplify reading and writing the XML format used by recent version of Microsoft Excel in Go programs. Current s

Geoffrey J. Teale 5.3k May 19, 2022