[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

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

2062.0. "FILE$ status returned?" by AIMTEC::BUTLER_T () Mon Jan 11 1993 21:06

    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.RTitleUserPersonal
Name
DateLines
2062.2IOSG::MAURICEBecause of the architect the building fell downTue Jan 12 1993 08:3329
    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.3From the author of File$HERO::MORPH::BenoySmoke me a kipper I&#039;ll be back for breakfastTue Jan 12 1993 11:0118
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