Vector.write_bytes
write_bytespathon_existing_file
Documentation
Writes (or appends) the Vector of bytes into the specified file. The behavior
specified in the existing_file parameter will be used if the file exists.
If the Vector contains any item which is not a Byte, an Illegal_Argument
will be raised. Enso follows the Java convention, that a Byte is between
-128 and 127.
If the path to the parent location cannot be found or the filename is invalid,
a File_Not_Found is raised.
If another error occurs, such as access denied, an File_Error.IO_Error is
raised.
Otherwise, the file is created with the encoded text written to it.
The method returns a File object for the written file.
Arguments
path: The path to the target file.on_existing_file: Specifies how to proceed if the file already exists.
Examples
Write the UTF-8 bytes of the text "$£§€¢" to a file.
import Standard.Examples
[36, -62, -93, -62, -89, -30, -126, -84, -62, -94].write_bytes Examples.scratch_file
Append the UTF-8 bytes of the text "$£§€¢" to a file.
import Standard.Examples
[36, -62, -93, -62, -89, -30, -126, -84, -62, -94].write_bytes Examples.scratch_file.write_bytes Examples.scratch_file Existing_File_Behavior.Append