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[IsLockable] - check to see if a file lock is obtainable
Calling Sequence
IsLockable(file, opt1, opt2, ...)
Parameters
file
-
filename or the file descriptor of an open file
opt1, opt2, ...
(optional) arguments
Description
The IsLockable(file) command checks if it is currently possible to obtain a file lock for file. With no optional arguments, an exclusive lock for the entire file is tested.
The IsLockable function returns true if the lock can be obtained and false otherwise. If an error occurs, an exception is raised.
If opt1, opt2, ... is bytes=low..high, then the bytes in file position low to high in file are locked. If relative is also specified then low and high are considered relative to the current file position. It is possible to lock regions beyond the end of the file using the bytes argument.
Some implementations of IsLockable will temporarily obtain the file lock. Therefore, during a call to IsLockable other processes may see the file as locked.
Using IsLockable to determine when Lock must be called is not safe. It is possible for another process to acquire a lock on the file between the call to IsLockable and Lock. Instead, Lock must be called and the false return handled appropriately.
For more information about Maple file locking capabilities, see the Lock help page.
IsLockable supports the type=shared argument on those operating systems that support it. The block argument is not a valid argument to IsLockable.
Examples
See Also
FileTools, FileTools[Lock], FileTools[Text][Open], FileTools[Unlock], IO_errors, iostatus
Download Help Document