filesystem for golang

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.

Similar Resources

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

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

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

Nov 19, 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

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

Jan 26, 2022

Warp across your filesystem in ~5 ms

Warp across your filesystem in ~5 ms

WarpDrive: the Go version. What does this do? Instead of having a huge cd routine to get where you want, with WarpDrive you use short keywords to warp

Dec 14, 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,

Dec 28, 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

Dec 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

Dec 28, 2022

The best HTTP Static File Server, write with golang+vue

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

Dec 30, 2022
A FileSystem Abstraction System for Go
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

Jan 9, 2023
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

Nov 14, 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

Sep 26, 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

Dec 18, 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

Jan 8, 2023
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

Oct 14, 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.

Dec 11, 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

Dec 26, 2022
Encrypted overlay filesystem written in Go
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

Jan 8, 2023
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

Dec 28, 2022