Skip to main content
Represents a file. This class is not available in CRM Online. Use open() before you call any other methods.

Constructors

File()

Initializes a new instance of the File class.

Methods

close()

Closes the file. The File object is then ready to open a new file.
Returns: CRMScript.Global.Void

eof()

Returns true if a read passed the end of file has been attempted.
Returns: CRMScript.Global.Bool - True if a read passed the end of file has been attempted; otherwise, false.
When you read lines in a loop, you can break out of the loop when this function return true.

flush()

Empties the output buffer, writing the data to the file.
Returns: CRMScript.Global.Void

open(String,String)

Opens the file to be available for other calls.
Returns: CRMScript.Global.Bool
Use open(String,String,String) to provide a codepage.Modes:

open(String,String,String)

Opens the file with a codepage to be available for other calls.
Returns: CRMScript.Global.Bool
Use open(String,String) if you don’t need to specify codepage.Modes:

readAll()

Returns all text from the file.
Returns: CRMScript.Global.String

readBinary()

Reads the file and returns binary data in a Byte array.
Returns: CRMScript.Global.Byte[] - Binary data.

readLine()

Returns the next line from the file or a null string if no more data in the file.
Returns: CRMScript.Global.String - The next line from the file or a null string if no more data in the file.

rewind()

Sets the current file pointer to the beginning of the file.
Returns: CRMScript.Global.Void Deletes the file.
Returns: CRMScript.Global.Bool

write(String)

Writes data to the file.
Returns: CRMScript.Global.Void
Can be called many times, adding more and more data to the file.

writeBinary(Byte[])

Writes binary data to file.
Returns: CRMScript.Global.Void