Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
writebytes - writes bytes from a string or list to a file or pipe
Calling Sequence
writebytes(file, bytes)
Parameters
file
-
file descriptor or filename
bytes
string, list of integers, or hardware Array
Description
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.
Thread Safety
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.
Examples
This is a testABC
See Also
convert/bytes, file_types, fprintf, IO_errors, readbytes, writeline
Download Help Document