module documentation

Object-oriented filesystem path representation.

Interface IFilePath File path object.
Class AbstractFilePath Abstract implementation of an IFilePath; must be completed by a subclass.
Class FilePath I am a path on the filesystem that only permits 'downwards' access.
Class Permissions A class representing read/write/execute permissions. Instantiate with any portion of the file's mode that includes the permission bits.
Class RWX A class representing read/write/execute permissions for a single user category (i.e. user/owner, group, or other/world). Instantiate with three boolean values: readable? writable? executable?.
Exception InsecurePath Error that is raised when the path provided to FilePath is invalid.
Exception LinkError An error with symlinks - either that there are cyclical symlinks or that symlink are not supported on this platform.
Exception UnlistableError An exception which is used to distinguish between errors which mean 'this is not a directory you can list' and other, more catastrophic errors.
Type Variable OtherAnyStr Undocumented
Variable FileMode Undocumented
Function _asFilesystemBytes Return path as a string of bytes suitable for use on this system's filesystem.
Function _asFilesystemText Return path as a string of unicode suitable for use on this system's filesystem.
Function _coerceToFilesystemEncoding Return a newpath that is suitable for joining to path.
Function _secureEnoughString Compute a string usable as a new, temporary filename.
Constant _CREATE_FLAGS Undocumented
Type Variable _Self Undocumented
OtherAnyStr = (source)

Undocumented

Value
TypeVar('OtherAnyStr', str, bytes)
FileMode = (source)

Undocumented

def _asFilesystemBytes(path: Union[bytes, str], encoding: Optional[str] = '') -> bytes: (source)

Return path as a string of bytes suitable for use on this system's filesystem.

Parameters
path:bytes or unicodeThe path to be made suitable.
encoding:Optional[str]The encoding to use if coercing to bytes. If none is given, sys.getfilesystemencoding is used.
Returns
bytesbytes
def _asFilesystemText(path: Union[bytes, str], encoding: Optional[str] = None) -> str: (source)

Return path as a string of unicode suitable for use on this system's filesystem.

Parameters
path:bytes or unicodeThe path to be made suitable.
encoding:Optional[str]The encoding to use if coercing to unicode. If none is given, sys.getfilesystemencoding is used.
Returns
strunicode
def _coerceToFilesystemEncoding(path: AnyStr, newpath: Union[bytes, str], encoding: Optional[str] = None) -> AnyStr: (source)

Return a newpath that is suitable for joining to path.

Parameters
path:AnyStrThe path that it should be suitable for joining to.
newpath:Union[bytes, str]The new portion of the path to be coerced if needed.
encoding:Optional[str]If coerced, the encoding that will be used.
Returns
AnyStrUndocumented
def _secureEnoughString(path: AnyStr) -> AnyStr: (source)

Compute a string usable as a new, temporary filename.

Parameters
path:AnyStrThe path that the new temporary filename should be able to be concatenated with.
Returns
the type of pathA pseudorandom, 16 byte string for use in secure filenames.
_CREATE_FLAGS = (source)

Undocumented

Value
TypeVar('_Self',
        bound='AbstractFilePath[Any]')