Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
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