File

Description

Functions to support general file IO operations

Functions

NameSignature and Synopsis
fileClosevoid fileClose (Object writerReader)
Closes the specified file reader.
fileExistsboolean fileExists (String path)
Tests whether the file or directory denoted by the specified path exists.
fileLengthlong fileLength (Object writerReader)
Returns the length of the specified file (in bytes).
fileReadLineString fileReadLine (Object fileReader)
Reads the next line of text from the specified file.
fileRemoveboolean fileRemove (String path)
Deletes the specified file or directory.
fileRenameboolean fileRename (String srcPath, String destPath)
Renames the specified file or directory.
fileSeekvoid fileSeek (Object writerReader, long pos)
Set the file-pointer offset at which the next IO will occur.
fileWritevoid fileWrite (Object fileWriter, String str)
Writes the string to the file as a sequence of bytes.
fileWriteLinevoid fileWriteLine (Object fileWriter, String str)
Writes the string to the file as a sequence of bytes followed by a new line character.
listFilesString[] listFiles (String dirPath, String filter)
Returns an array of files from the target directory that match the specified filter/pattern.
openFileObject openFile (String path, String mode)
Open the specified file for reading, and optionally, writing.
readFileAsBytesString readFileAsBytes (String filePath)
Read the contents of the specified file and return a byte[]
readFileAsStringString readFileAsString (String filePath)
Read the contents of the specified file and return a string