Operating System - OpenVMS
1752808 Members
6130 Online
108789 Solutions
New Discussion

C Code Returning Unreadable File ID String

 
SOLVED
Go to solution
Robert Atkinson
Respected Contributor

Re: C Code Returning Unreadable File ID String

Unfortunately, I neither program in C++ or Fortran, which is really why I can to the list.

Nor do I have any compilers, so I'm completely reliant on offers from people to code and compile the changes.

Hunter Goatley has done some of the work on porting some of these utilities to IA64, but as this is a code change, I thought it better to seek out a willing programmer to help.

By the way - you can't imagine how frustrating it is to use these utilities, have the source code, but no be able to change them yourself!

Rob.
Volker Halle
Honored Contributor

Re: C Code Returning Unreadable File ID String

Rob,

until someone picks up this 'enhancement request' and provides a solution, what do you try to do with this string ?

Could you read that string from DCL and parse it into the various fields ? Then call F$FID_TO_NAME ?

The FILE_IDENTIFICATION binary string seems to be in NAM$T_DVI format, i.e.

16 byte device name
6 byte FILE-ID
6 byte DIR-ID

See the $NAMDEF definition in SYS$LIBRARY:STARLET.REQ.

Volker.


Hein van den Heuvel
Honored Contributor

Re: C Code Returning Unreadable File ID String

Well, Hunter Goatley occasuionally stops by here, so he might be able to advice. I think he checks comp.os.vms and EISNER:: more frequently, as do others, so you may want to cross-post there.

( http://forums11.itrc.hp.com/service/forums/publicProfile.do?userId=CA1182816&forumId=1 )

The bit representation would be tedious, but more importantly 3 bytes too short.
The first code suggests it is not tightly packed, so you would miss out on 3 critical bytes out of which you can only fake 1 (the rvn).

You may be better of TRYing to tret the umprintable as a bit string in DCL and hope is all glues together nicely.
Somthing LIKE...

$id=0
$seq=0
$rvn=0
$id[0,16] = f$cvui(16*8,16,record)
$id[16,8] = f$cvui(21*8,8,record)
$seq[0,16] = f$cvui(18*8,16,record)
$rvn[0,8] = f$cvui(20*8,8,record)
! I could well be off by one
! I could well have FID(3) swapped
! Some of this can be expressed as string bytes, but I believe bit strings is more clear.

Capture the 'garbage' for a known file in a file and $DUMP it. See if you can make the HEX bytes for the file line up with the HEX represenation for the FID:

$ fid = f$file("login.com","FID") - "(" - ")"
$ show sym fid
FID = "78215,881,0"
$ f_id = 'f$eleme(0,",",fid)
$ f_se = 'f$eleme(1,",",fid)
$ f_rv = 'f$eleme(2,",",fid)
$ show sym f_*
F_ID = 78215 Hex = 00013187 Octal = 00000230607
F_RV = 0 Hex = 00000000 Octal = 00000000000
F_SE = 881 Hex = 00000371 Octal = 00000001561

fwiw,
Hein
Robert Atkinson
Respected Contributor

Re: C Code Returning Unreadable File ID String

Went with another solution instead of ExecSymb in the end.