Thanks, Lance. The book doesn't actually say so, and I'd sooner be sure than sorry.
Colin
------------------
Announcement
Collapse
No announcement yet.
File locking
Collapse
X
-
Guest replied
-
The CLOSE statement automatically takes care of unlocking the file, in accordance with the lock mode in the OPEN..LOCK statement.
If you explicitly use the LOCK statement (to lock records, bytes or a complete file), you *must* explicitly UNLOCK those portions before closing the file.
I hope this helps!
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Leave a comment:
-
File locking
As far as I can tell from the PB 3.5 manual, there are two
distinct ways to lock a file, as below:
open "myfile.dat" for binary as 1
lock 1
or:
open "myfile.dat" for binary lock read write as 1
The first one requires the file to be unlocked before closing the
file, but the book says nothing about unlocking the file if the
second method is used. Does the second way require unlocking,
or as it appears, the unlocking is automatic with the close
statement?
TIA, Colin.
------------------
Tags: None
Leave a comment: