fs
fs
#
Filesystem facts the scratch reasons with: sizes, free space, network mounts, promotion.
NETWORK_FILESYSTEMS = frozenset({'9p', 'afs', 'beegfs', 'ceph', 'cifs', 'glusterfs', 'gpfs', 'lustre', 'ncpfs', 'smb3', 'smbfs', 'sshfs'})
module-attribute
#
Filesystem types another machine serves, beside every nfs*; a fuse. prefix is ignored.
available_bytes(path)
#
The bytes free to an unprivileged writer on path's filesystem.
flush_tree(path)
#
Write path and every file and directory under it through to the disk.
Source code in capturegraph-lib/capturegraph/scratch/fs.py
network_filesystem(path)
#
The type of the network filesystem path is on, or None on a local disk.
Read from Linux's mount table; where there is none, every path counts as local.
Source code in capturegraph-lib/capturegraph/scratch/fs.py
promote(source, destination)
#
Move the tree source to destination atomically and durably, unless one is there.
source is on disk before the rename and the rename before this returns,
so an index row the caller writes afterwards never names files a power loss
can take back.
Returns:
| Type | Description |
|---|---|
bool
|
Whether |
bool
|
was already present and |
Source code in capturegraph-lib/capturegraph/scratch/fs.py
tree_size(path)
#
The bytes under path (a file's own size, a directory's recursive total).