Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/go-git/go-billy
/ functions
Functions
567 in github.com/go-git/go-billy
⨍
Functions
567
◇
Types & classes
65
↓ 191 callers
Method
Join
Join joins any number of path elements into a single path, adding a Separator if necessary. Join calls filepath.Clean on the result; in particular, al
fs.go:88
↓ 94 callers
Method
Symlink
Symlink creates a symbolic-link from link to target. target may be an absolute or relative path, and need not refer to an existing node. Parent direct
fs.go:126
↓ 83 callers
Method
Stat
Stat returns a FileInfo describing the named file.
fs.go:77
↓ 76 callers
Method
Name
Name returns the name of the file as presented to Open.
fs.go:171
↓ 63 callers
Function
newBoundOS
(d string, deduplicatePath bool)
osfs/os_bound.go:74
↓ 57 callers
Function
WriteFile
WriteFile writes data to a file named by filename in the given filesystem. If the file does not exist, WriteFile creates it with permissions perm; oth
util/util.go:109
↓ 47 callers
Method
Close
()
test/mock.go:126
↓ 44 callers
Method
Open
Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_
fs.go:70
↓ 42 callers
Function
New
Aligns with POSIX_SYMLOOP_MAX New creates a new filesystem wrapping up the given 'fs'. The created filesystem has its base in the given ChrootHelperec
helper/chroot/chroot.go:28
↓ 39 callers
Method
Create
Create creates the named file with mode 0666 (before umask), truncating it if it already exists. If successful, methods on the returned File can be us
fs.go:66
↓ 37 callers
Method
IsDir
()
memfs/memory.go:382
↓ 37 callers
Method
MkdirAll
MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm are use
fs.go:113
↓ 37 callers
Method
ReadDir
ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.
fs.go:108
↓ 31 callers
Method
OpenFile
OpenFile is the generalized open call; most users will use Open or Create instead. It opens the named file with specified flag (O_RDONLY etc.) and per
fs.go:75
↓ 29 callers
Function
New
New returns a new Memory filesystem.
memfs/memory.go:32
↓ 28 callers
Method
Readlink
Readlink returns the target path of link.
fs.go:128
↓ 27 callers
Method
Rename
Rename renames (moves) oldpath to newpath. If newpath already exists and is not a directory, Rename replaces it. OS-specific restrictions may apply wh
fs.go:81
↓ 26 callers
Method
Lstat
Lstat returns a FileInfo describing the named file. If the file is a symbolic link, the returned FileInfo describes the symbolic link. Lstat makes no
fs.go:122
↓ 25 callers
Method
Remove
Remove removes the named file or directory.
fs.go:83
↓ 21 callers
Method
Chroot
Chroot returns a new filesystem from the same type where the new root is the given path. Files outside of the designated directory tree cannot be acce
fs.go:163
↓ 18 callers
Method
New
(path string, mode os.FileMode, flag int)
memfs/storage.go:32
↓ 17 callers
Method
Capabilities
Capabilities returns the capabilities of a filesystem in bit flags.
fs.go:191
↓ 17 callers
Method
Close
()
memfs/memory.go:304
↓ 17 callers
Function
notFoundError
()
osfs/os_bound_test.go:1360
↓ 16 callers
Method
TempFile
TempFile creates a new temporary file in the directory dir with a name beginning with prefix, opens the file for reading and writing, and returns the
fs.go:100
↓ 16 callers
Method
Write
(p []byte)
memfs/memory.go:285
↓ 15 callers
Method
Mode
()
memfs/memory.go:374
↓ 14 callers
Method
abs
abs transforms filename to an absolute path, taking into account the base dir. Relative paths won't be allowed to ascend the base dir, so `../file` wi
osfs/os_bound.go:311
↓ 14 callers
Method
expandDot
(path string)
osfs/os_bound.go:274
↓ 12 callers
Method
underlyingPath
(filename string)
helper/chroot/chroot.go:35
↓ 11 callers
Method
Root
Root returns the root path of the filesystem.
fs.go:165
↓ 10 callers
Method
Lock
Lock locks the file like e.g. flock. It protects against access from other processes.
fs.go:181
↓ 10 callers
Method
Seek
(offset int64, whence int)
test/mock.go:122
↓ 10 callers
Method
Size
()
memfs/memory.go:370
↓ 10 callers
Method
Unlock
Unlock unlocks the file.
fs.go:183
↓ 9 callers
Function
New
New creates a new filesystem wrapping up 'fs' the intercepts all the calls made and errors if fs doesn't implement any of the billy interfaces.
helper/polyfill/polyfill.go:20
↓ 9 callers
Function
clean
(path string)
memfs/storage.go:184
↓ 9 callers
Function
cleanPath
(path string)
helper/mount/mount.go:216
↓ 9 callers
Function
createFile
(c *C, filesystem billy.Filesystem, path string)
util/walk_test.go:141
↓ 9 callers
Function
testCapabilities
(c *C, a, b billy.Basic)
helper/mount/mount_test.go:382
↓ 8 callers
Method
Get
(path string)
memfs/storage.go:95
↓ 8 callers
Method
Join
(elem ...string)
helper/chroot/chroot.go:298
↓ 8 callers
Function
New
New returns a new OS filesystem. By default paths are deduplicated, but still enforced under baseDir. For more info refer to WithDeduplicatePath. New
osfs/os.go:30
↓ 8 callers
Method
isMountpoint
(path string)
helper/mount/mount.go:211
↓ 8 callers
Function
requireSymlinkLoop
(c *C, err error, op string)
memfs/memory_test.go:454
↓ 7 callers
Method
Chmod
Chmod changes the mode of the named file to mode. If the file is a symbolic link, it changes the mode of the link's target.
fs.go:135
↓ 7 callers
Method
Close
Close closes the file, implementing fs.File (and io.Closer).
helper/iofs/iofs.go:126
↓ 7 callers
Method
Root
()
helper/chroot/chroot.go:405
↓ 7 callers
Function
Walk
Walk walks the file tree rooted at root, calling fn for each file or directory in the tree, including root. All errors that arise visiting files and d
util/walk.go:59
↓ 7 callers
Method
mustRelToMountpoint
(path string)
helper/mount/mount.go:201
↓ 7 callers
Method
testReadClose
(c *C, f File, content string)
test/basic.go:213
↓ 7 callers
Method
testWriteClose
(c *C, f File, content string)
test/basic.go:206
↓ 6 callers
Function
New
New creates a new filesystem wrapping up 'fs' the intercepts all the calls made to `mountpoint` path and redirecting it to `source` filesystem.
helper/mount/mount.go:27
↓ 6 callers
Function
RemoveAll
RemoveAll removes path and any children it contains. It removes everything it can but returns the first error it encounters. If the path does not exis
util/util.go:18
↓ 6 callers
Method
RemoveAll
(string)
util/util.go:27
↓ 5 callers
Method
ModTime
()
memfs/memory.go:378
↓ 5 callers
Function
NewFilesystemSuite
NewFilesystemSuite returns a new FilesystemSuite based on the given fs.
test/fs.go:25
↓ 5 callers
Function
TempFile
TempFile creates a new temporary file in the directory dir with a name beginning with prefix, opens the file for reading and writing, and returns the
util/util.go:163
↓ 5 callers
Method
followedPath
(filename string, followFinal bool, op string)
helper/chroot/chroot.go:43
↓ 5 callers
Method
getBasicAndPath
(path string)
helper/mount/mount.go:174
↓ 4 callers
Method
Len
()
memfs/memory.go:131
↓ 4 callers
Method
ReadAt
(b []byte, off int64)
test/mock.go:114
↓ 4 callers
Function
TempDir
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
util/util.go:193
↓ 4 callers
Function
makeFile
(fs billyfs.Basic, t *testing.T, filename string, contents string)
helper/iofs/iofs_test.go:113
↓ 4 callers
Function
newChrootOS
(baseDir string)
osfs/os_chroot.go:28
↓ 4 callers
Function
newFile
(fs billy.Filesystem, f billy.File, filename string)
helper/chroot/chroot.go:428
↓ 4 callers
Function
validPath
TODO: implement fs.GlobFS, which will be a fair bit more code. validPath checks that name is a valid io/fs path. In addition to the standard fs.ValidP
helper/iofs/iofs.go:49
↓ 3 callers
Method
Has
(path string)
memfs/storage.go:25
↓ 3 callers
Function
New
Wrap adapts a billy.Filesystem to a io.fs.FS.
helper/iofs/iofs.go:15
↓ 3 callers
Function
ReadFile
ReadFile reads the named file and returns the contents from the given filesystem. A successful call returns err == nil, not err == EOF. Because ReadFi
util/util.go:238
↓ 3 callers
Method
ReadFile
ReadFile reads the named file and returns its contents, implementing fs.ReadFileFS (returning contents or error).
helper/iofs/iofs.go:100
↓ 3 callers
Method
createDir
(fullpath string)
osfs/os_chroot.go:48
↓ 3 callers
Method
getSymlinkAndPath
(path string)
helper/mount/mount.go:192
↓ 3 callers
Method
insideBaseDirEval
insideBaseDirEval checks whether filename is contained within a dir that is within the fs.baseDir, by first evaluating any symlinks that either filena
osfs/os_bound.go:334
↓ 3 callers
Method
isBaseDir
(path string)
osfs/os_bound.go:290
↓ 3 callers
Function
isCrossBoundaries
(name string)
helper/chroot/chroot.go:211
↓ 3 callers
Function
mustExist
(filename string)
osfs/os_bound_test.go:1353
↓ 3 callers
Method
relativeToRoot
(filename string)
helper/chroot/chroot.go:162
↓ 3 callers
Function
reseed
()
util/util.go:140
↓ 3 callers
Method
resolveLink
(fullpath string, f *file)
memfs/memory.go:77
↓ 3 callers
Function
symlinkLoopError
(op, path string)
helper/chroot/chroot.go:124
↓ 3 callers
Function
testCapabilities
(c *C, basic billy.Basic)
helper/chroot/chroot_test.go:413
↓ 3 callers
Function
testCapabilities
(c *C, basic billy.Basic)
helper/polyfill/polyfill_test.go:79
↓ 3 callers
Method
testFileSeek
(c *C, offset int64, whence int)
test/basic.go:295
↓ 3 callers
Function
wrapFile
(f billy.File, filename string)
helper/mount/mount.go:257
↓ 2 callers
Function
Capabilities
Capabilities returns the features supported by a filesystem. If the FS does not implement Capable interface it returns all features.
fs.go:196
↓ 2 callers
Method
Join
Falls back to Go's filepath.Join, which works differently depending on the OS where the code is being executed.
memfs/memory.go:186
↓ 2 callers
Function
New
New creates a new filesystem wrapping up 'fs' the intercepts the calls to the TempFile method. The param defaultDir is used as default directory were
helper/temporal/temporal.go:17
↓ 2 callers
Method
OpenFile
(filename string, flag int, perm os.FileMode)
osfs/os_bound.go:82
↓ 2 callers
Method
OpenFile
(filename string, flag int, perm os.FileMode)
osfs/os_chroot.go:44
↓ 2 callers
Method
OpenFile
(filename string, flag int, perm os.FileMode)
memfs/memory.go:46
↓ 2 callers
Method
Read
(b []byte)
memfs/memory.go:243
↓ 2 callers
Method
ReadAt
(b []byte, off int64)
memfs/memory.go:254
↓ 2 callers
Method
Truncate
Truncate the file.
fs.go:185
↓ 2 callers
Method
Unwrap
()
helper/iofs/iofs_test.go:18
↓ 2 callers
Function
WithBoundOS
WithBoundOS returns the option of using a Bound filesystem OS.
osfs/os.go:46
↓ 2 callers
Method
createDir
(fullpath string)
osfs/os_bound.go:263
↓ 2 callers
Method
createParent
(path string, mode os.FileMode, f *file)
memfs/storage.go:56
↓ 2 callers
Method
getDirAndPath
(path string)
helper/mount/mount.go:183
↓ 2 callers
Function
getTempDir
(fs billy.Basic)
util/util.go:225
next →
1–100 of 567, ranked by callers