Known subclasses: twisted.protocols.ftp.FTPShell

Implements interfaces: twisted.protocols.ftp.IFTPShell

An anonymous implementation of IFTPShell

Instance Variable filesystemRoot The path which is considered the root of this shell. (type: twisted.python.filepath.FilePath)
Method __init__ Undocumented
Method makeDirectory Create a directory.
Method removeDirectory Remove a directory.
Method removeFile Remove a file.
Method rename Rename a file or directory.
Method receive Undocumented
Method openForReading Open path for reading.
Method openForWriting Reject write attempts by anonymous users with PermissionDeniedError.
Method access Determine whether access to the given path is allowed.
Method stat Retrieve information about the given path.
Method list Return the list of files at given path, adding keys stat informations if specified.
Method _path Undocumented
Method _statNode Shortcut method to get stat info on a node.
Method _stat_size Get the filepath's size as an int
Method _stat_permissions Get the filepath's permissions object
Method _stat_hardlinks Get the number of hardlinks for the filepath - if the number of hardlinks is not yet implemented (say in Windows), just return 0 since stat-ing a file in Windows seems to return st_nlink=0.
Method _stat_modified Get the filepath's last modified date
Method _stat_owner Get the filepath's owner's username. If this is not implemented (say in Windows) return the string "0" since stat-ing a file in Windows seems to return st_uid=0.
Method _stat_group Get the filepath's owner's group. If this is not implemented (say in Windows) return the string "0" since stat-ing a file in Windows seems to return st_gid=0.
Method _stat_directory Get whether the filepath is a directory
filesystemRoot =
The path which is considered the root of this shell. (type: twisted.python.filepath.FilePath)
def __init__(self, filesystemRoot): (source)
Undocumented
def _path(self, path): (source)
Undocumented
def makeDirectory(self, path): (source)

Create a directory.

ParameterspathThe path, as a list of segments, to create (type: list of unicode)
ReturnsA Deferred which fires when the directory has been created, or which fails if the directory cannot be created.
def removeDirectory(self, path): (source)

Remove a directory.

ParameterspathThe path, as a list of segments, to remove (type: list of unicode)
ReturnsA Deferred which fires when the directory has been removed, or which fails if the directory cannot be removed.
def removeFile(self, path): (source)

Remove a file.

ParameterspathThe path, as a list of segments, to remove (type: list of unicode)
ReturnsA Deferred which fires when the file has been removed, or which fails if the file cannot be removed.
def rename(self, fromPath, toPath): (source)

Rename a file or directory.

ParametersfromPathThe current name of the path. (type: list of unicode)
toPathThe desired new name of the path. (type: list of unicode)
ReturnsA Deferred which fires when the path has been renamed, or which fails if the path cannot be renamed.
def receive(self, path): (source)
Undocumented
def openForReading(self, path): (source)

Open path for reading.

ParameterspathThe path, as a list of segments, to open. (type: list of unicode)
ReturnsA Deferred is returned that will fire with an object implementing IReadFile if the file is successfully opened. If path is a directory, or if an exception is raised while trying to open the file, the Deferred will fire with an error.
def openForWriting(self, path): (source)

Reject write attempts by anonymous users with PermissionDeniedError.

def access(self, path): (source)

Determine whether access to the given path is allowed.

ParameterspathThe path, as a list of segments
ReturnsA Deferred which fires with None if access is allowed or which fails with a specific exception type if access is denied.
def stat(self, path, keys=()): (source)

Retrieve information about the given path.

This is like list, except it will never return results about child paths.

def list(self, path, keys=()): (source)

Return the list of files at given path, adding keys stat informations if specified.

Parameterspaththe directory or file to check. (type: str)
keysthe list of desired metadata (type: list of str)
def _statNode(self, filePath, keys): (source)

Shortcut method to get stat info on a node.

ParametersfilePaththe node to stat. (type: filepath.FilePath)
keysthe stat keys to get. (type: iterable)
def _stat_size(self, fp): (source)

Get the filepath's size as an int

Parametersfptwisted.python.filepath.FilePath
Returnsint representing the size
def _stat_permissions(self, fp): (source)

Get the filepath's permissions object

Parametersfptwisted.python.filepath.FilePath
Returnstwisted.python.filepath.Permissions of fp
def _stat_hardlinks(self, fp): (source)

Get the number of hardlinks for the filepath - if the number of hardlinks is not yet implemented (say in Windows), just return 0 since stat-ing a file in Windows seems to return st_nlink=0.

(Reference: http://stackoverflow.com/questions/5275731/os-stat-on-windows)

Parametersfptwisted.python.filepath.FilePath
Returnsint representing the number of hardlinks
def _stat_modified(self, fp): (source)

Get the filepath's last modified date

Parametersfptwisted.python.filepath.FilePath
Returnsint as seconds since the epoch
def _stat_owner(self, fp): (source)

Get the filepath's owner's username. If this is not implemented (say in Windows) return the string "0" since stat-ing a file in Windows seems to return st_uid=0.

(Reference: http://stackoverflow.com/questions/5275731/os-stat-on-windows)

Parametersfptwisted.python.filepath.FilePath
Returnsstr representing the owner's username
def _stat_group(self, fp): (source)

Get the filepath's owner's group. If this is not implemented (say in Windows) return the string "0" since stat-ing a file in Windows seems to return st_gid=0.

(Reference: http://stackoverflow.com/questions/5275731/os-stat-on-windows)

Parametersfptwisted.python.filepath.FilePath
Returnsstr representing the owner's group
def _stat_directory(self, fp): (source)

Get whether the filepath is a directory

Parametersfptwisted.python.filepath.FilePath
Returnsbool
API Documentation for Twisted, generated by pydoctor at 2017-09-23 19:45:03.