airfs.os.path

This namespace is equivalent to the Python standard library os.path namespace.

Following functions are replaced by Airfs functions:

airfs.os.path.exists(path)

Return True if the path refers to an existing path. Follow symlinks if any.

Equivalent to “os.path.exists”.

New in version 1.1.0.

Parameters:

path (path-like object) – Path or URL.

Returns:

True if the path exists.

Return type:

bool

airfs.os.path.getctime(path)

Return the creation time of the path object.

Equivalent to “os.path.getctime”.

New in version 1.2.0.

Parameters:

path (path-like object) – File path or URL.

Returns:

The number of seconds since the epoch (see the time module).

Return type:

float

Raises:
  • OSError – if the file does not exist or is inaccessible.

  • io.UnsupportedOperation – Information not available for this path.

airfs.os.path.getmtime(path)

Return the time of last access of path object.

Equivalent to “os.path.getmtime”.

New in version 1.0.0.

Parameters:

path (path-like object) – File path or URL.

Returns:

The number of seconds since the epoch (see the time module).

Return type:

float

Raises:
  • OSError – if the file does not exist or is inaccessible.

  • io.UnsupportedOperation – Information not available for this path.

airfs.os.path.getsize(path)

Return the size, in bytes, of the path object.

Equivalent to “os.path.getsize”.

New in version 1.0.0.

Parameters:

path (path-like object) – File path or URL.

Returns:

Size in bytes.

Return type:

int

Raises:
  • OSError – if the file does not exist or is inaccessible.

  • io.UnsupportedOperation – Information not available for this path.

airfs.os.path.isabs(path)

Return True if the path is an absolute pathname.

Equivalent to “os.path.isabs”.

New in version 1.1.0.

Parameters:

path (path-like object) – Path or URL.

Returns:

True if the path is absolute.

Return type:

bool

airfs.os.path.isdir(path)

Return True if the path is an existing directory.

Follow symlinks if any.

Equivalent to “os.path.isdir”.

New in version 1.1.0.

Parameters:

path (path-like object) – Path or URL.

Returns:

True if directory exists.

Return type:

bool

airfs.os.path.isfile(path)

Return True if the path is an existing regular file.

Follow symlinks if any.

Equivalent to “os.path.isfile”.

New in version 1.0.0.

Parameters:

path (path-like object) – Path or URL.

Returns:

True if file exists.

Return type:

bool

Return True if the path is an existing symlink.

Equivalent to “os.path.islink”.

New in version 1.2.0.

Parameters:

path (path-like object) – Path or URL.

Returns:

True if symlink.

Return type:

bool

airfs.os.path.ismount(path)

Return True if the pathname path is a mount point.

Equivalent to “os.path.ismount”.

New in version 1.1.0.

Parameters:

path (path-like object) – Path or URL.

Returns:

True if the path is a mount point.

Return type:

bool

airfs.os.path.relpath(path, start=None)

Return the relative path.

Return a relative file path to the path either from the current directory or from an optional start directory.

For storage objects, “path” and “start” are relative to storage root.

“/” are not stripped on a storage objects path. The ending slash is required on some storage to signify that the target is a directory.

Equivalent to “os.path.relpath”.

New in version 1.0.0.

Parameters:
  • path (path-like object) – Path or URL.

  • start (path-like object) – Relative from this optional directory. Default to “os.curdir” for local files.

Returns:

Relative path.

Return type:

str

airfs.os.path.samefile(path1, path2)

Return True if both pathname arguments refer to the same file or directory.

Equivalent to “os.path.samefile”.

New in version 1.1.0.

Parameters:
  • path1 (path-like object) – Path or URL.

  • path2 (path-like object) – Path or URL.

Returns:

True if same file or directory.

Return type:

bool

airfs.os.path.splitdrive(path)

Split the path to a drive tail pair.

Split the path into a pair (drive, tail) where drive is either a mount point or the empty string. On systems which do not use drive specifications, drive will always be the empty string.

In all cases, drive + tail will be the same as path.

Equivalent to “os.path.splitdrive”.

New in version 1.1.0.

Parameters:

path (path-like object) – Path or URL.

Returns:

drive, tail.

Return type:

tuple of str

See also

“os.path” standard library documentation

Python standard library documentation, for functions that are not documented here.