Announcement

Collapse
No announcement yet.

File locking

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Guest's Avatar
    Guest replied
    Thanks, Lance. The book doesn't actually say so, and I'd sooner be sure than sorry.
    Colin

    ------------------

    Leave a comment:


  • Lance Edmonds
    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:


  • Guest's Avatar
    Guest started a topic File locking

    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.

    ------------------
Working...
X