writes bytes from a string or list to a file or pipe
file descriptor or filename
string, list of integers, or hardware Array
The writebytes function writes the specified bytes to the indicated file.
writebytes returns a count of the number of characters written.
If the bytes are a string, the characters in the string are written. It is not possible to write a zero byte using a string argument.
If the bytes are a list of integers, each integer must be in the range 0..255. One byte is written for each integer.
If the bytes are a hardware Array, the data in the hardware Array's data space is written. The format of this data is architecture dependent. The file is guaranteed to be re-readable only on the same architecture on which it was written, although it may be compatible between some architectures.
If the file being written to is a STREAM or RAW file, and it is currently open in READ mode, it will be reopened in WRITE mode at the same offset. The file is opened with type TEXT if string data is used, or with type BINARY if list data is used.
If a file name is given, and that file is not yet open, it is opened in WRITE mode. The file is opened with type TEXT if string data is used, or with type BINARY if list data is used.
The writebytes command is thread safe as of Maple 15.
Parallel calls to file i/o commands on the same file descriptor will be serialized in an arbitrary order. If you need the commands to execute in a particular order you must use Maple's synchronization tools to enforce this. See Threads:-Mutex.
For more information on thread safety, see index/threadsafe.
writebytes⁡testFile,This is a test
This is a testABC
Download Help Document
What kind of issue would you like to report? (Optional)