Filesystem

Private

Description

Work with files and directories.

Capabilities

  • read_file
    Reads and returns the contents of the given filename.
  • write_file
    Writes provided content to the specified file path.
  • copy_file_or_directory
    Copies the contents in source to destination recursively, maintaining the source directory structure and mode, and overwriting existing files - working just like the Unix 'cp -Rf' command. Returns a list of all copied files and directories.
  • delete_file_or_directory
    Removes files and directories recursively at the given path - working just like the Unix 'rm -rf' command. Symlinks are not followed but simply removed, non-existing files are simply ignored (i.e. doesn't make this function fail). Returns a list of all deleted files and directories.
  • lookup_files_and_directories
    Traverses paths according to the given glob expression and returns a list of existing matches together with basic stat information (type, size and mtime). May be used to list a single directory (with glob like "*" or "./my_dir/*"), traverse it recursively (with glob like "**/*" or "/tmp/**/*") or check for specific path's existence & information (with glob like "path/to/file.txt"). Relative paths are resolved in "/home". Matching is case-sensitive and it does include dotfiles.
  • make_directory
    Creates the directory path, including missing parent directories - working just like the Unix 'mkdir -p' command.
  • rename_file_or_directory
    Renames the source file or directory to specified destination path. It can be used to move files (and directories) between directories.