Options
All
  • Public
  • Public/Protected
  • All
Menu

The FileSystem aptitude provides access to the ability to read, write, delete files.

Hierarchy

  • Filesystem

Index

Methods

  • copy(source: string, destination: string): Promise<void>
  • Copies a file from one location to another.

    Parameters

    • source: string

      path to the file to copy from

    • destination: string

      path to the file to copy to

    Returns Promise<void>

  • Returns all files in the specified directory

    Parameters

    • path: string

      path of the specified directory

    Returns Promise<FileInfo[]>

  • exists(path: string): Promise<boolean>
  • Return true if a file or directory exists at the specified location.

    Parameters

    • path: string

      path to the specified file or directory

    Returns Promise<boolean>

  • join(segments: string[]): Promise<string>
  • Join joins an array of path elements into a single path, separating them with an OS specific Separator. Empty elements are ignored. The result is Cleaned. However, if the argument list is empty or all its elements are empty, Join returns an empty string. On Windows, the result will only be a UNC path if the first non-empty element is a UNC path.

    Parameters

    • segments: string[]

      an array of path segments to join

    Returns Promise<string>

    • a single path separated with an OS specific Separator
  • makeDir(destination: string, writeMode: number): Promise<void>
  • Makes a directory at the specified location.

    Parameters

    • destination: string

      destination of where directory needs to be created at

    • writeMode: number

      file mode and permission bits

    Returns Promise<void>

  • move(source: string, destination: string): Promise<void>
  • Moves a file from one location to another.

    Parameters

    • source: string

      path of where to move the file from

    • destination: string

      path of where to move the file to

    Returns Promise<void>

  • openWithDefaultApplication(path: string): Promise<void>
  • Opens a file using the default tool for the extension provided in the path parameter, including directories. Limited to .csv, .doc, .docx, .pdf, .txt, .xls, .xlsx

    Parameters

    • path: string

      a string providing the path to the file to open

    Returns Promise<void>

  • readFile(path: string): Promise<Uint8Array>
  • Returns the contents of the specified file.

    Parameters

    • path: string

      path of the specified file

    Returns Promise<Uint8Array>

  • remove(source: string): Promise<void>
  • Removes a file/directory at the specified path.

    Parameters

    • source: string

      path of the file or directory to remove

    Returns Promise<void>

  • Returns info about a specified file/directory.

    Parameters

    • path: string

      path to the specified file or directory

    Returns Promise<FileInfo>

  • unzip(zipFilePath: string, outputDirPath: string): Promise<void>
  • Unzips sourced file to a specified directory.

    Parameters

    • zipFilePath: string

      path to the file to unzip. File has to have .zip extension.

    • outputDirPath: string

      path to the output directory. If the unzipped file already exists in the output directory, the file will be overwritten.

    Returns Promise<void>

  • workDir(): Promise<string>
  • Get the Loop's working directory

    Returns Promise<string>

    • the fully qualified path of the Loop's working directory as a string
  • Writes (overwrites or appends) data to the specified file with specific permissions. New file will be created if file not exist

    Parameters

    Returns Promise<void>

Generated using TypeDoc