ES3.AppendRaw
Append Raw Bytes
Description
Appends a byte array to a file, or creates a new file if one does not already exist.
Parameters
bytes | The bytes we want to append to the file. |
filePath |
[Optional] The relative or absolute path of the file we want to append our data to. |
settings |
[Optional] The settings we want to use to override the default settings. |
Examples
C#
1 2 |
// Appends a byte array to a file. ES3.AppendRaw(byteArray, "myFile.txt"); |
JS
1 2 |
// Appends a byte array to a file. ES3.AppendRaw(byteArray, "myFile.txt"); |
Append Raw String
Description
Appends a string to a file, or creates a new file if one does not already exist.
It will use the text encoding in the default settings to determine the encoding to use to store the string unless you provide a different encoding in an ES3Settings object provided as a parameter.
Because an encoding is applied, the string will be readable and editable in a text editor.
Parameters
str | The string we want to append to the file. |
filePath |
[Optional] The relative or absolute path of the file we want to append our value to. |
settings |
[Optional] The settings we want to use to override the default settings. |
Examples
C#
1 2 3 4 |
// Create a string which we want to append to a file. string str = "Line 1 \nLine2 \nLine3"; // Appends the string to a file. ES3.AppendRaw(str, "myFile.txt"); |
JS
1 2 3 4 |
// Create a string which we want to append to a file. var str : string = "Line 1 \nLine2 \nLine3"; // Appends the string to a file. ES3.AppendRaw(str, "myFile.txt"); |