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
fclose - closes a buffered file
close - closes an unbuffered file
Calling Sequence
fclose(file ...)
close(file ...)
Parameters
file
-
one or more names or file descriptors of open files to be closed
Description
The functions close and fclose are equivalent, and can be used interchangeably.
Closes the specified file, which is assumed to have been opened either implicitly or by fopen or open.
fclose and close do not return anything.
Closing a file ensures that all data is actually written to disk.
When exiting Maple by the quit, done, or stop command, all open files are automatically closed.
Closing a file which exists but is not open is harmless.
The number of open files allowed is system specific.
When writing many files, you must fclose() each of them to ensure that you do not run out of file handles.
Thread Safety
The fclose and close commands are thread safe as of Maple 15. Care must be taken when closing files that are used by multiple threads in parallel.
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
See Also
file_types, fopen, IO_errors, open
Download Help Document