...
Button handy |
---|
blank | true |
---|
color | #0052CC |
---|
name | Send Feedback |
---|
link | https://docs.google.com/forms/d/e/1FAIpQLScmToBe3vynAlb5fdKwCGxYqnTbDc66sIBgeecG2BuFDuHc7g/viewform?entry.2002826954=writeToBinaryFile+-+15488587 |
---|
width | auto |
---|
|
Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | writeToBinaryFile(filepath, bytes [, append]) | Package | file | Alias | | Pkg Usage | writeBinary(filepath, bytes [, append]) | |
Description
Excerpt |
---|
|
Prints in the specified bytes to a specified file. The file can be overwritten or appended to. |
Prints bytes to a specified file. The file can be overwritten or appended to.
Parameters
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
filepath | |
...
String | Yes | Specifies the file name to write in. |
|
...
var
bytes | Byte [] (Array of bytes) | Yes | Specifies the |
|
...
bytes to be written to the file |
|
...
...
charset
...
string
...
No
...
Specifies the charset used to write that file.
Available starting with katl-commons 4.0.0.
...
boolean
...
boolean
append | Boolean | No | 'true' if new |
|
...
bytes are added to the end of the file, otherwise 'false' |
|
...
Return type
Empty value. The returned value has no meaning.
Example
Code Block |
---|
printInFile(default) the whole file will be overwritten. |
|
Return Type
Integer
Return value represents the number of bytes written to the file.
Example
Example 1
Code Block |
---|
writeToBinaryFile("C:/storymyData.txtdat", "Once upon a time...");
|
Prints to the story.txt file the record Once upon a time...
...
Writes (appends) the data from the dataBytes variable to the file "myData.dat".
Note |
---|
It is recommended that you use forward slashes ( / ) for file paths. As a general observation use the silEnv() routine to create an absolute path. |
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "file_ |
---|
|
...
routine" and space = currentSpace ( ) | labels |
---|
|
...