class FTPAnonymousShell: (source)
Known subclasses: twisted.protocols.ftp.FTPShell
Constructor: FTPAnonymousShell(filesystemRoot)
Implements interfaces: twisted.protocols.ftp.IFTPShell
An anonymous implementation of IFTPShell
Method | __init__ |
Undocumented |
Method | access |
Determine whether access to the given path is allowed. |
Method | list |
Return the list of files at given path, adding keys stat informations if specified. |
Method | make |
Create a directory. |
Method | open |
Open path for reading. |
Method | open |
Reject write attempts by anonymous users with PermissionDeniedError . |
Method | receive |
Undocumented |
Method | remove |
Remove a directory. |
Method | remove |
Remove a file. |
Method | rename |
Rename a file or directory. |
Method | stat |
Retrieve information about the given path. |
Instance Variable | filesystem |
The path which is considered the root of this shell. |
Method | _path |
Undocumented |
Method | _stat |
Get whether the filepath is a directory |
Method | _stat |
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 |
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 |
Get the filepath's last modified date |
Method | _stat |
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 |
Get the filepath's permissions object |
Method | _stat |
Get the filepath's size as an int |
Method | _stat |
Shortcut method to get stat info on a node. |
Determine whether access to the given path is allowed.
Parameters | |
path | The path, as a list of segments |
Returns | |
A Deferred which fires with None if access is allowed or which fails with a specific exception type if access is denied. |
Return the list of files at given path, adding keys stat informations if specified.
Parameters | |
path:str | the directory or file to check. |
keys:list of str | the list of desired metadata |
twisted.protocols.ftp.FTPShell
Create a directory.
Parameters | |
path:list of unicode | The path, as a list of segments, to create |
Returns | |
A Deferred which fires when the directory has been created, or which fails if the directory cannot be created. |
Open path for reading.
Parameters | |
path:list of unicode | The path, as a list of segments, to open. |
Returns | |
A 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. |
twisted.protocols.ftp.FTPShell
Reject write attempts by anonymous users with PermissionDeniedError
.
twisted.protocols.ftp.FTPShell
Remove a directory.
Parameters | |
path:list of unicode | The path, as a list of segments, to remove |
Returns | |
A Deferred which fires when the directory has been removed, or which fails if the directory cannot be removed. |
twisted.protocols.ftp.FTPShell
Remove a file.
Parameters | |
path:list of unicode | The path, as a list of segments, to remove |
Returns | |
A Deferred which fires when the file has been removed, or which fails if the file cannot be removed. |
twisted.protocols.ftp.FTPShell
Rename a file or directory.
Parameters | |
from | The current name of the path. |
to | The desired new name of the path. |
Returns | |
A Deferred which fires when the path has been renamed, or which fails if the path cannot be renamed. |
Retrieve information about the given path.
This is like list, except it will never return results about child paths.
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)
Parameters | |
fp | twisted.python.filepath.FilePath |
Returns | |
str representing the owner's group |
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)
Parameters | |
fp | twisted.python.filepath.FilePath |
Returns | |
int representing the number of hardlinks |
Get the filepath's last modified date
Parameters | |
fp | twisted.python.filepath.FilePath |
Returns | |
int as seconds since the epoch |
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)
Parameters | |
fp | twisted.python.filepath.FilePath |
Returns | |
str representing the owner's username |
Get the filepath's permissions object
Parameters | |
fp | twisted.python.filepath.FilePath |
Returns | |
twisted.python.filepath.Permissions of fp |
Get the filepath's size as an int
Parameters | |
fp | twisted.python.filepath.FilePath |
Returns | |
int representing the size |