At 11:05 AM -0700 5/24/01, Peter Prymmer wrote:
>On Thu, 24 May 2001, Craig A. Berry wrote:
> > There are various potential pitfalls here.  For one thing, we use
>> lib$fid_to_name in some cases (see Perl_cando()), and lock IDs in
>> other cases (see encode_dev()).  I don't think either will work for
>> remote DECNET nodes, much less NFS.
>
>To Craig:
>Just out of curiosity, other than parsing the output of
>`DIRECTORY/FULL $file`; how does one invert lib$fid_to_name()?  There does
>not seem to be a lib$name_to_fid() library routine.

In C, the st_ino element of the stat structure is a 3-word array
containing the FID.  IIRC, in the return from Perl's stat() routine
you get the first 2 words squished next to each other in a longword.

>From any language, you can do a $QIO to the file (or actually the
directory containing the file) with IO$_ACCESS and it will return the
FID in the FIB (File Information Block).  I believe you have to start
with the [000000] directory and do a chain of QIOs to each directory
file, shuffling the FID into the DID (Directory ID) until you get
down to the file you want.

Of course if you're staying with DCL, you only have to remember one
3-letter abbreviation:

$ write sys$output f$file_attributes("sys$login:login.com","fid")
(29072,31,0)

-- 
____________________________________________
Craig A. Berry                  
mailto:[EMAIL PROTECTED]

"Literary critics usually know what they're
talking about. Even if they're wrong."
        -- Perl creator Larry Wall

Reply via email to