◷ Reading Time: 3 minutes
IO operations allow you to read/write files from local and network files, or create folders and access current directories.
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)
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)
Opens a text file, reads all lines of the file, and then closes the file.
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Determines whether the specified file exists.
Deletes a file.
Determines whether the given path refers to an existing directory on disk.
Creates a folder based on the path. If any internal folders do not exist, it creates them as well.
Creates a zero size file at a temp directory and returns the full path.
Gets or sets the fully qualified path of the current working directory.
- path (string): when it is set, will update the current path.
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.
Gets a new temp directory fully qualified path which ends with \ character. The returned folder exists and is empty.
Returns the absolute path for the specified path string.
Returns the list of files and folders on a specific directory based on a path.
pathList (path, type,
- 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)