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
filepos - sets or returns the position within a file
Calling Sequence
filepos(file)
filepos(file, pos)
Parameters
file
-
file name or file descriptor
pos
integer offset into the file
Description
filepos with one argument returns the current position within the specified file. This is the position at which the next read or write takes place.
filepos with two arguments sets the position within the specified file and returns that new position.
A specified position of infinity sets the current position to the end of the file.
If a file name is given, and that file is not yet open, it is opened in READ mode with type BINARY.
With a TEXT file, to determine a position suitable for passing to filepos, call filepos. Only values returned by filepos(file) are guaranteed to be meaningful when used in filepos(file, value). Counting characters while reading or writing is not reliable, because newline characters are translated from/to local conventions, which may use more than a single character. However, filepos(file,infinity) is always valid.
Thread Safety
The filepos 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
Moves to the end and returns the size.
See Also
feof, iostatus
Download Help Document