easyfuse.filesystem¶
This module implements the classes that map to filesystem objects.
-
class
BaseEntry
(name, fs, parent, *, inode=None)[source]¶ Bases:
llfuse.EntryAttributes
The base class that all filesystem classes should subclass.
This is a subclass
llfuse.EntryAttributes
and its attributes that are required to have a working filesystem are implemented. Most others are not actually implemented currently.Parameters: - name (str) – The name of the entry.
- fs (
dict
or dictlike) – This stores the mapping from an inode number to aFile
orDirectory
object. The newly createdBaseEntry
will be added to this as well. It should most likely be thefs
attribute of the instance that creates this entry. - parent (
Directory
) – The filesystem parent of this - inode (int) – An explicit inode number. If it is
None
a new number will automatically be generated. Only in rare cases this automatic generation is not sufficient, so use this only when really necassary.
-
lookup_count
= 0[source]¶ The amount of times this entry has been looked up by the kernel. This is increased by a couple of methodes called on
Operations
by normal filesystem operations.
-
modified
[source]¶ The moment of last modification of the entry.
This is measured in seconds since the UNIX epoch.
-
depth
[source]¶ The depth of the entry in the directory tree.
This basically counts the number of parents this entry has.
-
generate_inode_number
()[source]¶ Generate a unique inode number.
By default this is done by taking part of the result of uuid4. This method can be overridden if another method is preferred.
-
delete
()[source]¶ Basic deletion operations.
Override this when code needs to be executed on deletion. Keep calling this one by using
super
though, since it does some internal things.
-
class
File
(*args, **kwargs)[source]¶ Bases:
easyfuse.filesystem.BaseEntry
A class that represents a filesystem file.
If a file is supposed to be synced, set the
content
attribute toNone
after initialization.Parameters:
-
class
Directory
(*args, **kwargs)[source]¶ Bases:
easyfuse.filesystem.BaseEntry
A class that represents a directory in the filesystem.
Parameters: -
dirty_children
[source]¶ Indicates if the
children
need to be synced.It is set to
True
if a child of this directory isdirty
or hasdirty_children
itself.
-