Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Filesystem

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

Index

Type aliases

WriteMode

WriteMode: number

WriteOperation

WriteOperationAppend

WriteOperationAppend: 2

WriteOperationOverwrite

WriteOperationOverwrite: 1

Methods

copy

  • 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>

dir

  • dir(path: string): Promise<FileInfo[]>
  • Returns all files in the specified directory

    Parameters

    • path: string

      path of the specified directory

    Returns Promise<FileInfo[]>

exists

  • 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

  • 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

listenDir

listenFile

makeDir

  • makeDir(destination: string, writeMode: WriteMode): Promise<void>
  • Makes a directory at the specified location.

    Parameters

    • destination: string

      destination of where directory needs to be created at

    • writeMode: WriteMode

      file mode and permission bits

    Returns Promise<void>

move

  • 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

  • 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

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

    Parameters

    • path: string

      path of the specified file

    Returns Promise<Uint8Array>

remove

  • 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>

stat

  • Returns info about a specified file/directory.

    Parameters

    • path: string

      path to the specified file or directory

    Returns Promise<FileInfo>

unzip

  • 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

  • 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

writeFile

  • 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