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
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