Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 13 MAR 1998 11:06:57AM louis wrote:

Is there a way to lock a DOS file (in AREV Basic) before

using the OSOPEN/OSBREAD/OSWRITE type commands? We have

a DOS app that needs to read/delete shared files/records.

TIA


At 13 MAR 1998 02:08PM Victor Engel wrote:

Is there a way to lock a DOS file (in AREV Basic) before using the OSOPEN/OSBREAD/OSWRITE type commands? We have a DOS app that needs to read/delete shared files/records. TIA

OSOPEN opens the file with write access. Check STATUS() to see if another process already has the file open. The possible values for STATUS() are:

0 No error

1 Bad operating system filename

2 Access denied by operating system

4 File does not exist

5 Undefined error

If you still want to implement locking, you can. Just establish a standard that you will use. If you're using Netware, locks are handled by semaphores, so the file need not even exist. I'd suggest something like this:

OPEN 'DOS' to DOS_HANDLE THEN

 LOCK DOS_HANDLE, OS_NAME THEN
  • Put your opens, reads, etc. here ; don't forget to unlock
 END

END

Remember, DOS is an Arev file name with DOS filenames as its records.

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/ed3ea01e8fe2f34b852565c6005308a7.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1