filesystem

module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: Apache-2.0

README

Filesystem Library

This Go library provides advanced filesystem features not available in the standard library's io/fs. It introduces write support via writefs and a configurable virtual filesystem layer via vfsrw.

Core Features

  • Write Support (writefs): Extends io/fs with standard interfaces for write operations like Create, Append, MkDir, Rename, Remove, and WriteFile.
  • Virtual File System (vfsrw): A unified layer that maps multiple backend filesystems into a single hierarchy using a vfs:/<backend>/<path> scheme.

Available Filesystems

This library includes various storage backends and wrappers:

Getting Started

Installation
go get github.com/je4/filesystem/v3
Basic Usage with vfsrw
import (
	"github.com/je4/filesystem/v3/pkg/vfsrw"
	"github.com/je4/utils/v2/pkg/zLogger"
)

// Define backend configuration
cfg := vfsrw.Config{
	"data": &vfsrw.VFS{
		Type: "os",
		OS: &vfsrw.OS{BaseDir: "/var/lib/mydata"},
	},
}

// Initialize VFS
vfs, _ := vfsrw.NewFS(cfg, logger)

// Open a file with the vfs:/ prefix
f, _ := vfs.Open("vfs:/data/logs/app.log")

For more details on each package, see the Packages Overview.

Directories

Path Synopsis
cmd
vfsstat command
zipasfolder command
pkg
zipfsrw
Package zipfsrw provides a functionality to create and update content of a zip file
Package zipfsrw provides a functionality to create and update content of a zip file
zipfsw
Package zipfsw provides a functionality to create and update content of a zip file
Package zipfsw provides a functionality to create and update content of a zip file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL