Documentation ¶
Overview ¶
Package fsutil provides utilities around package io/fs, mainly a namespace feature built upen a union file system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OSName ¶
OSName translates the given file or directory name relative to the OS file system tree root, where the file or directory actually resides. OSName is able to return the corresponding OS file name only if the file system has been bound to a NameSpace with option WithNewOSDir previously.
Types ¶
type BindOption ¶
type BindOption func(*bindAction)
func BindBefore ¶
func BindBefore() BindOption
func WithNewOSDir ¶
func WithNewOSDir(dirname string) BindOption
func WithValue ¶ added in v0.2.0
func WithValue(key, value interface{}) BindOption
type Item ¶
Item constitutes an interface to the file system an item belongs to. Item is implemented by Files and DirEntries provides by a UnionFS.
type NameSpace ¶
type NameSpace struct {
UnionFS
}
Namespace is a wrapper around UnionFS that provides a functionality basically similar to Plan 9's bind command
type PrefixFSOption ¶
type PrefixFSOption func(*prefixFS)
func WithModTime ¶
func WithModTime(t time.Time) PrefixFSOption
WithModTime sets the modification time of prefix path elements.
func WithPerm ¶
func WithPerm(perm fs.FileMode) PrefixFSOption
WithPerm sets the permissions of prefix path elements to perm.
type UnionFS ¶
A UnionFS is an FS presenting the union of the file systems in a slice. If multiple file systems provide a particular file, Open uses the FS listed earlier in the slice. If multiple file systems provide a particular directory, ReadDir presents the concatenation of all the directories listed in the slice (with duplicates removed).