Syntax
writeToBinaryFile(filepath, bytes [, append])
Description
Prints in the specified bytes to a file. The file can be overwritten or appended to.Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
filepath | string | Yes | Specifies the file name to write in. |
bytes | byte [] | Yes | Specifies the bytes to be written to the file. |
boolean | boolean | No | 'true' if new line is added after character expression is added to file, otherwise 'false' (default) the whole file will be overwritten. |
Return type
Integer
Return value represents the number of bytes written to the file.
Example
writeToBinaryFile("C:/myData.dat", dataBytes[], true)
Writes (appends) the data from the dataBytes variable to the file “myData.dat”.
Notes
It is recommended that you use forward slashes ( / ) for file paths. As a general observation use the silEnv() routine to create an absolute path.