Package-Level Type Names (total 27, in which 21 are exported)
/* sort exporteds by: | */
FsFs
Chmod changes the mode of the named file to mode.
Chown changes the uid and gid of the named file.
Chtimes changes the access and modification times of the named file
Create creates a file in the filesystem, returning the file and an
error, if any happens.
( T) DirExists(path string) (bool, error)( T) Exists(path string) (bool, error)( T) FileContainsAnyBytes(filename string, subslices [][]byte) (bool, error)( T) FileContainsBytes(filename string, subslice []byte) (bool, error)( T) GetTempDir(subPath string) string( T) IsDir(path string) (bool, error)( T) IsEmpty(path string) (bool, error)
Mkdir creates a directory in the filesystem, return an error if any
happens.
MkdirAll creates a directory path and all parents that does not exist
yet.
The name of this FileSystem
Open opens a file, returning it or an error, if any happens.
OpenFile opens a file using the given flags and the given mode.
ReadDir reads the directory named by dirname and returns
a list of sorted directory entries.
ReadFile reads the file named by filename and returns the contents.
A successful call returns err == nil, not err == EOF. Because ReadFile
reads the whole file, it does not treat an EOF from Read as an error
to be reported.
Remove removes a file identified by name, returning an error, if any
happens.
RemoveAll removes a directory path and any children it contains. It
does not fail if the path does not exist (return nil).
Rename renames a file.
Same as WriteReader but checks to see if file/directory already exists.
Stat returns a FileInfo describing the named file, or an error, if any
happens.
TempDir creates a new temporary directory in the directory dir
with a name beginning with prefix and returns the path of the
new directory. If dir is the empty string, TempDir uses the
default directory for temporary files (see os.TempDir).
Multiple programs calling TempDir simultaneously
will not choose the same directory. It is the caller's responsibility
to remove the directory when no longer needed.
TempFile creates a new temporary file in the directory dir,
opens the file for reading and writing, and returns the resulting *os.File.
The filename is generated by taking pattern and adding a random
string to the end. If pattern includes a "*", the random string
replaces the last "*".
If dir is the empty string, TempFile uses the default directory
for temporary files (see os.TempDir).
Multiple programs calling TempFile simultaneously
will not choose the same file. The caller can use f.Name()
to find the pathname of the file. It is the caller's responsibility
to remove the file when no longer needed.
( T) Walk(root string, walkFn filepath.WalkFunc) error
WriteFile writes data to a file named by filename.
If the file does not exist, WriteFile creates it with permissions perm;
otherwise WriteFile truncates it before writing.
Takes a reader and a path and writes the content
T : Fs
IOFS adopts afero.Fs to stdlib io/fs.FS
FsFs
Chmod changes the mode of the named file to mode.
Chown changes the uid and gid of the named file.
Chtimes changes the access and modification times of the named file
Create creates a file in the filesystem, returning the file and an
error, if any happens.
( T) Glob(pattern string) ([]string, error)
Mkdir creates a directory in the filesystem, return an error if any
happens.
MkdirAll creates a directory path and all parents that does not exist
yet.
The name of this FileSystem
( T) Open(name string) (fs.File, error)
OpenFile opens a file using the given flags and the given mode.
( T) ReadDir(name string) ([]fs.DirEntry, error)( T) ReadFile(name string) ([]byte, error)
Remove removes a file identified by name, returning an error, if any
happens.
RemoveAll removes a directory path and any children it contains. It
does not fail if the path does not exist (return nil).
Rename renames a file.
Stat returns a FileInfo describing the named file, or an error, if any
happens.
( T) Sub(dir string) (fs.FS, error)( T) wrapError(op, path string, err error) error
T : io/fs.FS
T : io/fs.GlobFS
T : io/fs.ReadDirFS
T : io/fs.ReadFileFS
T : io/fs.StatFS
T : io/fs.SubFS
func NewIOFS(fs Fs) IOFS
Linker is an optional interface in Afero. It is only implemented by the
filesystems saying so.
It will call Symlink if the filesystem itself is, or it delegates to, the os filesystem,
or the filesystem otherwise supports Symlink's.
( T) SymlinkIfPossible(oldname, newname string) error
*BasePathFs
*CopyOnWriteFsOsFs
*ReadOnlyFsSymlinker(interface)
Lstater is an optional interface in Afero. It is only implemented by the
filesystems saying so.
It will call Lstat if the filesystem iself is, or it delegates to, the os filesystem.
Else it will call Stat.
In addtion to the FileInfo, it will return a boolean telling whether Lstat was called or not.
( T) LstatIfPossible(name string) (os.FileInfo, bool, error)
*BasePathFs
*CopyOnWriteFs
*MemMapFsOsFs
*ReadOnlyFsSymlinker(interface)
dirEntry provides adapter from os.FileInfo to fs.DirEntry
FileInfofs.FileInfo( T) Info() (fs.FileInfo, error)
// abbreviation for Mode().IsDir()
// modification time
// file mode bits
// base name of the file
// length in bytes for regular files; system-dependent for others
// underlying data source (can return nil)
( T) Type() fs.FileMode
T : io/fs.DirEntry
T : io/fs.FileInfo
GetTempDir returns the default temp directory with trailing slash
if subPath is not empty then it will be created recursively with mode 777 rwx rwx rwx
Glob returns the names of all files matching pattern or nil
if there is no matching file. The syntax of patterns is the same
as in Match. The pattern may describe hierarchical names such as
/usr/*/bin/ed (assuming the Separator is '/').
Glob ignores file system errors such as I/O errors reading directories.
The only possible returned error is ErrBadPattern, when pattern
is malformed.
This was adapted from (http://golang.org/pkg/path/filepath) and uses several
built-ins from that package.
IsDir checks if a given path is a directory.
IsEmpty checks if a given file or directory is empty.
Transform characters with accents into plain forms.
ReadAll reads from r until an error or EOF and returns the data it read.
A successful call returns err == nil, not err == EOF. Because ReadAll is
defined to read from src until EOF, it does not treat an EOF from Read
as an error to be reported.
glob searches for files matching pattern in the directory dir
and appends them to matches. If the directory cannot be
opened, it returns the existing matches. New matches are
added in lexicographical order.
hasMeta reports whether path contains any of the magic characters
recognized by Match.
readAll reads from r until an error or EOF and returns the data it read
from the internal buffer allocated with a specified capacity.
readDirNames reads the directory named by dirname and returns
a sorted list of directory entries.
adapted from https://golang.org/src/path/filepath/path.go
readerContains reports whether any of the subslices is within r.
ErrNoReadlink is the error that will be wrapped in an os.Path if a file system
does not support the readlink operation either directly or through its delegated filesystem.
As expressed by support for the LinkReader interface.
ErrNoSymlink is the error that will be wrapped in an os.LinkError if a file system
does not support Symlink's either directly or through its delegated filesystem.
As expressed by support for the Linker interface.
Random number state.
We generate random temporary file names so that there's a good
chance the file doesn't exist yet - keeps the number of tries in
TempFile to a minimum.
present in the overlay - with cache time == 0 it may exist in the base,
with cacheTime > 0 it exists in the base and is same age or newer in the
overlay
happens if someone writes directly to the overlay without
going through this union
not present in the overlay, unknown if it exists in the base:
present in the overlay and in base, base file is newer:
const chmodBitsfs.FileMode = 13631999 // Only a subset of bits are allowed to be changed. Documented under os.Chmod()
The pages are generated with Goldsv0.3.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.