IO

◷ Reading Time: 3 minutes

IO operations allow you to read/write files from local and network files, or create folders and access current directories.

fileWrite

Creates a new file, writes the specified content to the file, and then closes the file. If the target file already exists, it is overwritten.

 fileWrite (path, content)

fileAppend

Opens a file, appends the specified content to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.

 fileAppend (path, content)

fileReadText

Opens a text file, reads all lines of the file, and then closes the file.

 fileReadText (path)

fileReadBytes

Opens a binary file, reads the contents of the file into a byte array, and then closes the file.

 fileReadBytes (path)

fileExists

Determines whether the specified file exists.

 fileExists (path)

fileDelete

Deletes a file.

 fileDelete (path)

pathExists

Determines whether the given path refers to an existing directory on disk.

 pathExists (path)

pathCreate

Creates a folder based on the path. If any internal folders do not exist, it creates them as well.

 pathCreate (path)

fileTemp

Creates a zero size file at a temp directory and returns the full path.

 fileTemp ()

pathCurrent

Gets or sets the fully qualified path of the current working directory.

 pathCurrent (path)
  • path (string): when it is set, will update the current path.

pathCombine

Combines two strings into a path.

 pathCombine (path1, path2, ...)
  • path1, path2,… (string): list of strings that are going to be concat as a single path.

pathTemp

Gets a new temp directory fully qualified path which ends with \ character. The returned folder exists and is empty.

 pathTemp ()

pathFullDirectory

Returns the absolute path for the specified path string.

 pathFullDirectory (path)

pathList

Returns the list of files and folders on a specific directory based on a path.

 pathList (path, type,
includeSubDirectories, pattern)
  • path: A path to query for a particular item i.e. file or folder or both
  • type: specifies what type should be included in the list.
    • file: Include files
    • folder: Include folders
  • includeSubDirectories: a boolean value (true or false) that specifies whether the search operation should include all sub-directories or only the current path’s directory.
  • pattern: This can contain a combination of valid literal and wildcard characters.
Example: List all folders and files of a location, and includes items only on the top folder.
pathList('d:/folder-tests', 'file folder', false)


List of files related to current path
pathList((pathCombine(pathCurrent(), "JSONfiles")),"file",false)
Updated on January 29, 2020

Was this article helpful?

Related Articles