On Thu, 24 May 2001, Craig A. Berry wrote:
> >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.
OK thanks for the pointer, I hadn't thought that stat() was so
extended.
> 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.
Thanks for that too.
> 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)
Indeed - good shortcut. I was hoping to avoid the DCL though.
Peter Prymmer