fs

The fs commands module.

These commands are used in the following models: MP5103

THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED.

Please report an issue if one is found.

Attributes and Functions
- fs.cwd()
- fs.is_dir()
- fs.is_file()
- fs.mkdir()
- fs.readdir()
- fs.rmdir()

Fs

Bases: BaseTSPCmd

The fs command tree.

Properties and methods
  • .cwd(): The fs.cwd() function.
  • .is_dir(): The fs.is_dir() function.
  • .is_file(): The fs.is_file() function.
  • .mkdir(): The fs.mkdir() function.
  • .readdir(): The fs.readdir() function.
  • .rmdir(): The fs.rmdir() function.

cwd

cwd() -> str

Run the fs.cwd() function.

Description
  • This function returns the absolute path of the current working directory.
TSP Syntax
- fs.cwd()
Returns:
  • str

    The result of the function call.

Raises:

is_dir

is_dir(path: str) -> str

Run the fs.is_dir() function.

Description
  • This function tests whether or not the specified path refers to a directory.
TSP Syntax
- fs.is_dir()
Parameters:
  • path (str) –

    The path of the file system entry to test.

Returns:
  • str

    The result of the function call.

Raises:

is_file

is_file(path: str) -> str

Run the fs.is_file() function.

Description
  • Tests whether the specified path refers to a file (as opposed to a directory).
TSP Syntax
- fs.is_file()
Parameters:
  • path (str) –

    The path of the file system entry to test.

Returns:
  • str

    The result of the function call.

Raises:

mkdir

mkdir(new_path: str) -> str

Run the fs.mkdir() function.

Description
  • This function creates a directory at the specified path.
TSP Syntax
- fs.mkdir()
Parameters:
  • new_path (str) –

    Location (path) of where to create the new directory.

Returns:
  • str

    The result of the function call.

Raises:

readdir

readdir(path: str) -> str

Run the fs.readdir() function.

Description
  • This function returns a list of the file system entries in the directory.
TSP Syntax
- fs.readdir()
Parameters:
  • path (str) –

    The directory path.

Returns:
  • str

    The result of the function call.

Raises:

rmdir

rmdir(path: str) -> None

Run the fs.rmdir() function.

Description
  • This function removes a directory from the file system.
TSP Syntax
- fs.rmdir()
Parameters:
  • path (str) –

    The path of the directory to remove.

Raises: