Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
FileTools[Position] - set or return the current position within a file
Calling Sequence
Position(file, pos)
Parameters
file
-
filename or file descriptor
pos
(optional) integer offset into the file or infinity
Description
The Position(file) command returns the current position within the specified file. This is the position to which the next write takes place, or from which the next read takes place.
The Position(file, pos) command sets the current 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 file does not refer to an open file, an error is raised.
To determine a position suitable for passing to Position in a TEXT file, call Position. Only values returned by Position(file) are guaranteed to be meaningful when used in Position(file, pos). Counting characters while reading and/or writing is not reliable, because newline characters are translated from/to local conventions, which may use more than a single character. However, Position(file, infinity) is always valid.
Examples
See Also
FileTools, FileTools[AtEndOfFile], FileTools[Text], IO_errors, iostatus
Download Help Document