| Title: | *OLD* ALL-IN-1 (tm) Support Conference |
| Notice: | Closed - See Note 4331.l to move to IOSG::ALL-IN-1 |
| Moderator: | IOSG::PYE |
| Created: | Thu Jan 30 1992 |
| Last Modified: | Tue Jan 23 1996 |
| Last Successful Update: | Fri Jun 06 1997 |
| Number of topics: | 4343 |
| Total number of notes: | 18308 |
In trying to answer Note 2061 I have an interesting question.
Whenever I use the FILE$ data set to check for the file
being locked - it returns a status of 1 "succes." If
I give it an incorrect filename it will return a status
of 26 "file not found."
<cab lock exclulsive !oa$curdoc
<newdir other_user
<get #filename = "full path name"
<get #status = file$status[#filename]
<get #status ! result is "1"
Does the FILE$ dataset return a status of "1" in place
of a status of "20 - file locked by another user" as
part of its coding?
Thanks,
Tim
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 2062.2 | IOSG::MAURICE | Because of the architect the building fell down | Tue Jan 12 1993 08:33 | 29 | |
Hi,
> <cab lock exclulsive !oa$curdoc
> <newdir other_user
The lock will be lost. The function NEWDIR internally does a CAB CLOSE
function, which close the File Cabinet and releases all locks. You need
to reserve the document instead.
> <get #filename = "full path name"
> <get #status = file$status[#filename]
You have a missing dot. the line should be
<get #status = file$.status[#filename]
> <get #status ! result is "1"
FILE$ will not open the file just to return the status. To get file
locked you can:
get file$.%open[#filename]
get #acl = .acl
get #status = .status
get file$.%close[#filename]
Cheers
Stuart
| |||||
| 2062.3 | From the author of File$ | HERO::MORPH::Benoy | Smoke me a kipper I'll be back for breakfast | Tue Jan 12 1993 11:01 | 18 |
RE .0 .2 Stuart is right, his example will get you what you want. Probably <get file$.acl[#filename] .status will work aswell. As a matter of interest you don't have to use the acl field, you can use any field that would force the dataset to open the file ie block_size or one of the key information fields. Also cab lock uses the VMS lock manager to provide a lock id that is it only locks the namespace and never puts an RMS lock on the file. Hope this helps -Paul | |||||