class documentation
class TrackingFilePath(filepath.FilePath): (source)
A subclass of filepath.FilePath
which maintains a list of all other paths created by clonePath.
Method | __init__ |
Convert a path string to an absolute path if necessary and initialize the FilePath with the result. |
Method | clone |
Override filepath.FilePath.clonePath to give the new path a reference to the same tracking list. |
Method | open |
Override 'open' to track all files opened by this path. |
Method | opened |
Return a list of all TrackingFilePath s associated with this TrackingFilePath that have had their open() method called. |
Instance Variable | opened |
A list of all file objects opened by this TrackingFilePath or any other TrackingFilePath in trackingList. |
Instance Variable | tracking |
A list of all paths created by this path via clonePath (which also includes paths created by methods like parent, sibling, child, etc (and all paths subsequently created by those paths, etc). |
Inherited from FilePath
:
Method | __cmp__ |
Undocumented |
Method | __getstate__ |
Support serialization by discarding cached os.stat results and returning everything else. |
Method | __repr__ |
Undocumented |
Method | as |
Return this FilePath in bytes -mode. |
Method | as |
Return this FilePath in unicode -mode. |
Method | basename |
Retrieve the final component of the file path's path (everything after the final path separator). |
Method | changed |
Clear any cached information about the state of this path on disk. |
Method | child |
Create and return a new FilePath representing a path contained by self. |
Method | child |
Return my first existing child with a name in paths. |
Method | chmod |
Changes the permissions on self, if possible. Propagates errors from os.chmod up. |
Method | copy |
Copies self to destination. |
Method | create |
Exclusively create a file, only if this file previously did not exist. |
Method | create |
Create the directory the FilePath refers to. |
Method | dirname |
Retrieve all of the components of the FilePath 's path except the last one (everything up to the final path separator). |
Method | exists |
Check if this FilePath exists. |
Method | get |
Retrieve the time that this file was last accessed. |
Method | get |
Retrieves the device containing the file. The inode number and device number together uniquely identify the file, but the device number is not necessarily consistent across reboots or system crashes. |
Method | get |
Returns the group ID of the file. |
Method | get |
Retrieve the file serial number, also called inode number, which distinguishes this file from all other files on the same device. |
Method | get |
Retrieve the time of last access from this file. |
Method | get |
Retrieves the number of hard links to the file. |
Method | get |
Returns the permissions of the file. Should also work on Windows, however, those permissions may not be what is expected in Windows. |
Method | getsize |
Retrieve the size of this file in bytes. |
Method | get |
Retrieve the time of the last status change for this file. |
Method | get |
Returns the user ID of the file's owner. |
Method | glob |
Assuming I am representing a directory, return a list of FilePaths representing my children that match the given pattern. |
Method | isabs |
Check if this FilePath refers to an absolute path. |
Method | is |
Returns whether the underlying path is a block device. |
Method | isdir |
Check if this FilePath refers to a directory. |
Method | isfile |
Check if this file path refers to a regular file. |
Method | islink |
Check if this FilePath points to a symbolic link. |
Method | is |
Returns whether the underlying path is a socket. |
Method | link |
Creates a symlink to self to at the path in the FilePath linkFilePath. |
Method | listdir |
List the base names of the direct children of this FilePath . |
Method | makedirs |
Create all directories not yet existing in path segments, using os.makedirs . |
Method | move |
Move self to destination - basically renaming self to whatever destination is named. |
Method | parent |
A file path for the directory containing the file at this file path. |
Method | preauth |
Use me if path might have slashes in it, but you know they're safe. |
Method | realpath |
Returns the absolute target as a FilePath if self is a link, self otherwise. |
Method | remove |
Removes the file or directory that is represented by self. If self.path is a directory, recursively remove all its children before removing the directory. If it's a file or link, just delete it. |
Method | require |
Sets the alwaysCreate variable. |
Method | restat |
Re-calculate cached effects of 'stat'. To refresh information on this path after you know the filesystem may have changed, call this method. |
Method | set |
Replace the file at this path with a new file that contains the given bytes, trying to avoid data-loss in the meanwhile. |
Method | sibling |
Attempt to return a path with my name, given the extension at ext. |
Method | sibling |
Attempt to return a path with my name, given multiple possible extensions. |
Method | splitext |
Split the file path into a pair (root, ext) such that root + ext == path. |
Method | temporary |
Construct a path referring to a sibling of this path. |
Method | touch |
Updates the access and last modification times of the file at this file path to the current time. Also creates the file if it does not already exist. |
Instance Variable | always |
When opening this file, only succeed if the file does not already exist. |
Instance Variable | path |
The path from which 'downward' traversal is permitted. |
Property | sep |
Return a filesystem separator. |
Method | _as |
Return the path of this FilePath as bytes. |
Method | _as |
Return the path of this FilePath as text. |
Method | _get |
If pattern is bytes, return FilePath.path as bytes . Otherwise, return FilePath.path as unicode . |
Class Variable | _chunk |
Undocumented |
Instance Variable | _statinfo |
Undocumented |
Inherited from AbstractFilePath
(via FilePath
):
Method | __hash__ |
Hash the same as another FilePath with the same path as mine. |
Method | children |
List the children of this path object. |
Method | descendant |
Retrieve a child or child's child of this path. |
Method | getatime |
Deprecated. Use getAccessTime instead. |
Method | get |
Retrieve the contents of the file at this path. |
Method | getctime |
Deprecated. Use getStatusChangeTime instead. |
Method | getmtime |
Deprecated. Use getModificationTime instead. |
Method | parents |
Retrieve an iterator of all the ancestors of this path. |
Method | segments |
Return a list of segments between a child and its ancestor. |
Method | sibling |
Return a FilePath with the same directory as this instance but with a basename of path. |
Method | walk |
Yield myself, then each of my children, and each of those children's children in turn. |
overrides
twisted.python.filepath.FilePath.open
Override 'open' to track all files opened by this path.
Return a list of all TrackingFilePath
s associated with this TrackingFilePath
that have had their open() method called.
A list of all file objects opened by this TrackingFilePath
or any other TrackingFilePath
in trackingList.