Skip to content

pathlib

sanya_fritz edited this page Apr 20, 2024 · 1 revision

Documentation for the pathlib

This is a library for working with paths

All functions contains in pathlib namespace

example: if(pathlib.isFile(filePath)

Functions

  • bool pathlib.make_directory(ponystring path): Creates a directory at the specified path.

    • Parameters:
      • path: The path to the directory to be created.
    • Returns: true if the directory creation is successful, false otherwise.
  • bool pathlib.remove_directory(ponystring path): Removes a directory at the specified path.

    • Parameters:
      • path: The path to the directory to be removed.
    • Returns: true if the directory removal is successful, false otherwise.
  • bool pathlib.deleteAllFilesInDirectory(const ponystring& directory): Deletes all files in a directory.

    • Parameters:
      • directory: The path to the directory containing files to be deleted.
    • Returns: true if all files are successfully deleted, false otherwise.
  • bool pathlib.copyFile(const ponystring& source, const ponystring& destination): Copies a file from the source path to the destination path.

    • Parameters:
      • source: The path to the source file.
      • destination: The path to the destination where the file will be copied.
    • Returns: true if the file is successfully copied, false otherwise.
  • bool pathlib.moveFile(const ponystring& source, const ponystring& destination): Moves a file from the source path to the destination path.

    • Parameters:
      • source: The path to the source file.
      • destination: The path to the destination where the file will be moved.
    • Returns: true if the file is successfully moved, false otherwise.
  • bool pathlib.isFile(const ponystring& filePath): Checks if a given path corresponds to a regular file.

    • Parameters:
      • filePath: The path to the file to be checked.
    • Returns: true if the path corresponds to a regular file, false otherwise.

Clone this wiki locally