Method | __eq__ |
Undocumented |
Method | cleanup |
No summary |
Method | copyto |
No summary |
Method | exists |
No summary |
Method | file |
Get a File object for a path below this folder |
Method | get_file_tree_as_text |
No summary |
Method | list |
List the file contents |
Method | new_file |
No summary |
Method | new_subdir |
No summary |
Method | remove |
Remove this folder, fails if it is not empty. |
Method | remove_children |
Recursively remove everything below this folder . |
Method | resolve_dir |
Get a Dir object for a path relative to this folder |
Method | resolve_file |
Get a File object for a path relative to this folder |
Method | subdir |
Get a Dir object for a path below this folder |
Method | touch |
Create this folder and any parent folders that do not yet exist. @param mode: creation mode (e.g. 0700) |
Method | walk |
No summary |
Method | _list |
Undocumented |
Inherited from UnixPath
:
Class Method | new_from_zim_config |
Returns a new object based on the string representation for that path |
Method | __add__ |
Concatenates paths, only creates objects of the same class. See Dir.file() and Dir.subdir() instead to create other objects. |
Method | __init__ |
Constructor |
Method | __iter__ |
Undocumented |
Method | __ne__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | commonparent |
No summary |
Method | ctime |
Get the creation time of the file path. @returns: the mtime timestamp |
Method | ischild |
Check if this path is a child path of a folder @returns: True if this path is a child path of parent |
Method | isdir |
Check if this path is a folder or not. Used to detect if e.g. a File object should have really been a Dir object. @returns: True when this path is a folder |
Method | isequal |
No summary |
Method | iswritable |
Check if a file or folder is writable. Uses permissions of parent folder if the file or folder does not (yet) exist. @returns: True if the file or folder is writable |
Method | monitor |
Creates a FSObjectMonitor for this path |
Method | mtime |
Get the modification time of the file path. @returns: the mtime timestamp |
Method | relpath |
No summary |
Method | rename |
No summary |
Method | serialize_zim_config |
Returns the file path as string for serializing the object |
Method | size |
Get file size in bytes See format_file_size() to get a human readable label @returns: file size in bytes |
Method | split |
No summary |
Instance Variable | path |
the absolute file path as string file system encoding (should only be used by low-level functions) |
Property | basename |
Basename property |
Property | dir |
Returns a Dir object for the parent dir |
Property | dirname |
Dirname property |
Property | uri |
File uri property |
Property | user_path |
User_path property |
Static Method | _parse_uri |
Undocumented |
Method | _set_path |
Undocumented |
Instance Variable | _serialized |
Undocumented |
Returns | |
True when successfull (so False means it still exists). |
Parameters | |
dest | a Dir object |
zim.fs.UnixPath.exists
Returns | |
True if the file or folder exists | |
Unknown Field: implementation | |
must be implemented by sub classes in order that they enforce the type of the resource as well |
File
object for a path below this folderParameters | |
path | a (relative) file path as string, tuple or FilePath object. When path is a File object already this method still enforces it is below this folder. So this method can be used as check as well. |
Returns | |
a File object | |
Raises | |
PathLookupError | if the path is not below this folder |
Parameters | |
raw | see list() |
Returns | |
file listing as string |
zim.fs.FilteredDir
Parameters | |
glob | a file name glob to filter the listed files, e.g "*.png" |
includehidden | if True include hidden files (e.g. names starting with "."), ignore otherwise |
includetmp | if True include temporary files (e.g. names ending in "~"), ignore otherwise |
raw | for filtered folders (FilteredDir instances) setting raw to True will disable filtering |
Returns | |
a sorted list of names for files and subdirectories. Will not return names that could not be decoded properly and will throw warnings if those are encountered. Hidden files are silently ignored. |
File
object for a new file below this folder. Like file()
but guarantees the file does not yet exist by adding sequential numbers if needed. So the resulting file may have a modified name.Parameters | |
path | a (relative) file path as string, tuple or FilePath object. |
Returns | |
a File object | |
Raises | |
PathLookupError | if the path is not below this folder |
Dir
object for a new sub-folder below this folder. Like subdir()
but guarantees the folder does not yet exist by adding sequential numbers if needed. So the resulting folder may have a modified name.Parameters | |
path | a (relative) file path as string, tuple or FilePath object. |
Returns | |
a Dir object | |
Raises | |
PathLookupError | if the path is not below this folder |
Recursively remove everything below this folder .
WARNING: This is quite powerful and can do a lot of damage when executed for the wrong folder, so pleae make sure to double check the dir is actually what you think it is before calling this.
Dir
object for a path below this folderParameters | |
path | a (relative) file path as string, tuple or FilePath object. When path is a Dir object already this method still enforces it is below this folder. So this method can be used as check as well. |
Returns | |
a Dir object | |
Raises | |
PathLookupError | if the path is not below this folder |
Parameters | |
mode | creation mode (e.g. 0700) |