pg.io.StdFileSystem

Accessible via pg.io.StdFileSystem.

class StdFileSystem[source]

Bases: pg.io.FileSystem

The standard file system.

Methods:

chmod(path, mode)

Changes the permission of a file.

copy(oldpath, newpath)

Copies a file to a new path.

exists(path)

Returns True if a path exists.

getctime(path)

Returns the creation time of a file.

getmtime(path)

Returns the last modification time of a file.

glob(pattern)

Lists all files or sub-directories.

isdir(path)

Returns True if a path is a directory.

listdir(path)

Lists all files or sub-directories.

mkdir(path[, mode])

Makes a directory based on a path.

mkdirs(path[, mode, exist_ok])

Makes a directory chain based on a path.

open(path[, mode])

Opens a file with a path.

rename(oldpath, newpath)

Renames a file based on a path.

rm(path)

Removes a file based on a path.

rmdir(path)

Removes a directory based on a path.

rmdirs(path)

Removes a directory chain based on a path.

chmod(path, mode)[source]

Changes the permission of a file.

Return type:

None

copy(oldpath, newpath)[source]

Copies a file to a new path.

Return type:

None

exists(path)[source]

Returns True if a path exists.

Return type:

bool

getctime(path)[source]

Returns the creation time of a file.

Return type:

float

getmtime(path)[source]

Returns the last modification time of a file.

Return type:

float

glob(pattern)[source]

Lists all files or sub-directories.

Return type:

list[str]

isdir(path)[source]

Returns True if a path is a directory.

Return type:

bool

listdir(path)[source]

Lists all files or sub-directories.

Return type:

list[str]

mkdir(path, mode=511)[source]

Makes a directory based on a path.

Return type:

None

mkdirs(path, mode=511, exist_ok=True)[source]

Makes a directory chain based on a path.

Return type:

None

open(path, mode='r', **kwargs)[source]

Opens a file with a path.

Return type:

pg.io.File

rename(oldpath, newpath)[source]

Renames a file based on a path.

Return type:

None

rm(path)[source]

Removes a file based on a path.

Return type:

None

rmdir(path)[source]

Removes a directory based on a path.

Return type:

None

rmdirs(path)[source]

Removes a directory chain based on a path.

Return type:

None