Unlock - Maple Help

FileTools

 Unlock
 release a file lock

 Calling Sequence Unlock(file, opt1, opt2, ...)

Parameters

 file - filename or the file descriptor of a locked file opt1, opt2, ... - (optional) arguments

Description

 • The Unlock(file) command releases a file lock for file.  With no optional arguments, the exclusive lock for the entire file is released.
 • The optional arguments passed to Unlock must match those given to Lock when the lock was acquired.
 • If opt1, opt2, ... is bytes=low..high, then the bytes in file position low to high in file are unlocked.  If relative is also specified, then low and high are considered relative to the current file position.   The bytes range must match a range given to a call to Lock.
 • The Unlock command does not return anything.  If an error occurs, an exception  is raised.
 > $\mathrm{FileTools}\left[\mathrm{Text}\right]\left[\mathrm{Open}\right]\left(\mathrm{testfile}\right):$
 > $\mathrm{FileTools}\left[\mathrm{Lock}\right]\left(\mathrm{testfile},\mathrm{bytes}=10..20\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{FileTools}\left[\mathrm{Unlock}\right]\left(\mathrm{testfile},\mathrm{bytes}=10..20\right)$