# unlock_file

Definition: | unlock_file(integer fn, sequence range)
Description: | Unlock an open file fn, or a portion of file fn. You must have previously locked the file using lock_file(). On Windows you can unlock a range of bytes within a file by specifying the range parameter as {first_byte, last_byte}. The same range of bytes must have been locked by a previous call to lock_file(). On Linux you can currently only lock or unlock an entire file. The range parameter should be {} when you want to unlock an entire file. On Linux, range must always be {}.
pwa/p2js: | Not supported.
Comments: | You should unlock a file as soon as possible so other processes can use it. Any files that you have locked will be automatically unlocked when your program terminates. See lock_file() for further comments and an example.
Implementation: | via :%opUnLock / flock() in builtins\VM\pfileioN.e (an autoinclude) - be warned however it is low-level complicated stuff that you do not need to know.
See Also: | lock_file