<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: C Code Returning Unreadable File ID String in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142657#M43293</link>
    <description>Went with another solution instead of ExecSymb in the end.</description>
    <pubDate>Wed, 02 Dec 2009 14:35:00 GMT</pubDate>
    <dc:creator>Robert Atkinson</dc:creator>
    <dc:date>2009-12-02T14:35:00Z</dc:date>
    <item>
      <title>C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142644#M43280</link>
      <description>The C code below (from ExecSymb) returns this string as the File ID, which is unusable :- &lt;BR /&gt;&lt;BR /&gt;FILE_IDENTIFICATION&lt;BR /&gt;␊_$1$DGA151␤␤␤␤␤ú#M␤␤d-␤␤&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Anybody know the code to return it in the (n,n,n) format?&lt;BR /&gt;&lt;BR /&gt;Rob.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;C&lt;BR /&gt;C       Look at the identification of the file being processed.  Strip off the&lt;BR /&gt;C       device name, and get the fileid and directory id values.&lt;BR /&gt;C&lt;BR /&gt;              STREAM(NSTREAM).ENTRY=LONG(MESSAGE(IP:IP+3))&lt;BR /&gt;              IP=STREAM(NSTREAM).POS(SMBMSG$K_FILE_IDENTIFICATION)&lt;BR /&gt;              STREAM(NSTREAM).DEVICE_NAME_LEN=BYTE(MESSAGE(IP:IP))&lt;BR /&gt;              STREAM(NSTREAM).DEVICE_NAME=MESSAGE(IP+1:IP+15)&lt;BR /&gt;              STREAM(NSTREAM).FID(1)=WORD(MESSAGE(IP+16:IP+17))&lt;BR /&gt;              STREAM(NSTREAM).FID(2)=WORD(MESSAGE(IP+18:IP+19))&lt;BR /&gt;              STREAM(NSTREAM).FID(3)=WORD(MESSAGE(IP+20:IP+21))&lt;BR /&gt;              DID(1)=WORD(MESSAGE(IP+22:IP+23))&lt;BR /&gt;              DID(2)=WORD(MESSAGE(IP+24:IP+25))&lt;BR /&gt;              DID(3)=WORD(MESSAGE(IP+26:IP+27))&lt;BR /&gt;C</description>
      <pubDate>Mon, 24 Nov 2008 16:41:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142644#M43280</guid>
      <dc:creator>Robert Atkinson</dc:creator>
      <dc:date>2008-11-24T16:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142645#M43281</link>
      <description>File ID's are often treated as 3 consecutive 16-bit words, even though that wrong. The code sample shown appears to attempt this. To print that data you want to do something similar to:&lt;BR /&gt;&lt;BR /&gt;printf ("%s(%d,%d,%%)\n", device, did[1], did[2], did[2])&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;To do this properlyy you need to add the 1st 16 bits to 65536*times 8 bits from the 3rd word and display that as file ID.&lt;BR /&gt;&lt;BR /&gt;See layout in the RMS NAMDEF.&lt;BR /&gt;Uage example for that:&lt;BR /&gt;&lt;BR /&gt;i = atoi (argv[1]);&lt;BR /&gt;nam.nam$w_fid_num = (short) i;&lt;BR /&gt;nam.nam$b_fid_nmx = (unsigned char) (i &amp;gt;&amp;gt; 16);&lt;BR /&gt;nam.nam$w_fid_seq = (short) atoi ( argv[2] );&lt;BR /&gt;nam.nam$w_fid_rvn = (short) atoi ( argv[3] );&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Nov 2008 17:18:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142645#M43281</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-11-24T17:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142646#M43282</link>
      <description>Rob,&lt;BR /&gt;&lt;BR /&gt;I don't see how the listed code lines can return this:&lt;BR /&gt;&lt;BR /&gt;FILE_IDENTIFICATION&lt;BR /&gt;â  _$1$DGA151â ¤â ¤â ¤â ¤â ¤Ãº#Mâ ¤â ¤î¤»dî¤»-â ¤â ¤î¤»&lt;BR /&gt;&lt;BR /&gt;Do you?&lt;BR /&gt;&lt;BR /&gt;Hint...show us the code that produced the lines above.&lt;BR /&gt;&lt;BR /&gt;/Guenther</description>
      <pubDate>Mon, 24 Nov 2008 19:55:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142646#M43282</guid>
      <dc:creator>GuentherF</dc:creator>
      <dc:date>2008-11-24T19:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142647#M43283</link>
      <description>&amp;gt; The C code below [...]&lt;BR /&gt;&lt;BR /&gt;Uh, comments which have a "C" in column one&lt;BR /&gt;are not usually described as "C code".</description>
      <pubDate>Mon, 24 Nov 2008 21:15:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142647#M43283</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-11-24T21:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142648#M43284</link>
      <description>This looks more like FORTRAN then C to me.&lt;BR /&gt;&lt;BR /&gt;Maybe you could post an example with your formatting code? Put hardcoded values into the FID fields for illustration.&lt;BR /&gt;&lt;BR /&gt;Here's an example in MACRO32 showing how to format a FID from a NAM block. &lt;BR /&gt;&lt;BR /&gt;        .TITLE FormatFid&lt;BR /&gt;        .PSECT data,RD,WRT,NOEXE&lt;BR /&gt;$NAMDEF&lt;BR /&gt;MyNAM: $NAM&lt;BR /&gt;&lt;BR /&gt;BinFid: .WORD  14426 ; FID (79962,17,0)&lt;BR /&gt;        .WORD     17&lt;BR /&gt;        .BYTE      0&lt;BR /&gt;        .BYTE      1&lt;BR /&gt;&lt;BR /&gt;outstr: .ASCID /12345678901234567890/&lt;BR /&gt;fmtstr: .ASCID /(!UL,!UW,!UB)/&lt;BR /&gt;        .PSECT code,RD,NOWRT,EXE&lt;BR /&gt;        .ENTRY start,^M&lt;R2&gt;&lt;BR /&gt;&lt;BR /&gt;; first set up the NAM block with our canned FID&lt;BR /&gt;        MOVC3 #NAM$S_FID,BinFid,MyNAM+NAM$R_FID_FIELDS&lt;BR /&gt;&lt;BR /&gt;; Calculate NUM from FID_NUM and FID_NMX&lt;BR /&gt;        MOVZBL MyNAM+NAM$B_FID_NMX,R2&lt;BR /&gt;        ASHL #16,R2,R2&lt;BR /&gt;        MOVW MyNAM+NAM$W_FID_NUM,R2&lt;BR /&gt;&lt;BR /&gt;        $FAO_S ctrstr=fmtstr outlen=outstr outbuf=outstr -&lt;BR /&gt;                p1=R2 p2=MyNAM+NAM$W_FID_SEQ p3=MyNAM+NAM$B_FID_RVN&lt;BR /&gt;&lt;BR /&gt;; display result&lt;BR /&gt;        PUSHAB outstr&lt;BR /&gt;        CALLS #1,G^LIB$PUT_OUTPUT&lt;BR /&gt;        RET&lt;BR /&gt;        .END start&lt;BR /&gt;&lt;/R2&gt;</description>
      <pubDate>Mon, 24 Nov 2008 21:45:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142648#M43284</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-11-24T21:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142649#M43285</link>
      <description>&amp;gt; This looks more like FORTRAN then C to me.&lt;BR /&gt;&lt;BR /&gt;But look at all those C's!&lt;BR /&gt;&lt;BR /&gt;(You're no fun.)</description>
      <pubDate>Mon, 24 Nov 2008 22:03:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142649#M43285</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-11-24T22:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142650#M43286</link>
      <description>Steven&lt;BR /&gt;&lt;BR /&gt;Thanks for the good laugh !</description>
      <pubDate>Tue, 25 Nov 2008 08:07:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142650#M43286</guid>
      <dc:creator>labadie_1</dc:creator>
      <dc:date>2008-11-25T08:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142651#M43287</link>
      <description>Sorry Guys - I'd got a mental block and purely assumed it was written in 'C'.&lt;BR /&gt;&lt;BR /&gt;I've attached the original code, taken from &lt;A href="http://vms.process.com/scripts/fileserv/fileserv.com?EXECSYMB" target="_blank"&gt;http://vms.process.com/scripts/fileserv/fileserv.com?EXECSYMB&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There's actually a section in the code which says :-&lt;BR /&gt;&lt;BR /&gt;C&lt;BR /&gt;C Item conversion information&lt;BR /&gt;C&lt;BR /&gt;C Each item has an item name, the length of the name, and an item&lt;BR /&gt;C conversion type, used for converting the item value to ASCII for&lt;BR /&gt;C streams requiring ASCII-format item values.  The following table&lt;BR /&gt;C lists the possible item types:&lt;BR /&gt;C       type meaning&lt;BR /&gt;C       ---- -------&lt;BR /&gt;C  1 No translation (already ASCII, or item not easily&lt;BR /&gt;C   translated to ASCII, so left in original form)&lt;BR /&gt;C  2 Binary longword, converted to hexadecimal in the&lt;BR /&gt;C   format "%Xnnnnnnnn"&lt;BR /&gt;C  3 Date and time, converted to dd-mmm-yyyy hh:mm:ss.cc&lt;BR /&gt;C   format (with one space between date and time)&lt;BR /&gt;C  4 UIC, converted to [gggggg,mmmmmm] format with octal&lt;BR /&gt;C   group and member numbers containing leading zeroes.&lt;BR /&gt;C  5 Bitstring, converted to a list of which bits are&lt;BR /&gt;C   set.  Up to 16 bytes of data can be included in the&lt;BR /&gt;C   item (since the CHARACTERISTICS item is 16 bytes long.)&lt;BR /&gt;C   The list is a series of decimal numbers separated by&lt;BR /&gt;C   commas (e.g. hex 641 becomes "0,6,9,10")&lt;BR /&gt;C&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Perhaps it's simply a case of defining FILEID as a type '5'? :-&lt;BR /&gt;&lt;BR /&gt; DATA SMBITEM(SMBMSG$K_FILE_IDENTIFICATION) /'FILE_IDENTIFICATION'/&lt;BR /&gt; DATA SMBITEMLEN(SMBMSG$K_FILE_IDENTIFICATION) /19/&lt;BR /&gt; DATA SMBITEMTYPE(SMBMSG$K_FILE_IDENTIFICATION) /1/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rob.</description>
      <pubDate>Tue, 25 Nov 2008 09:25:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142651#M43287</guid>
      <dc:creator>Robert Atkinson</dc:creator>
      <dc:date>2008-11-25T09:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142652#M43288</link>
      <description>Rob,&lt;BR /&gt;&lt;BR /&gt;the item type of the file specification is probably defaulted to '1', because that binary data can not easily be converted to an ASCII string.&lt;BR /&gt;&lt;BR /&gt;There is a LIB$FID_TO_NAME RTL routine, which could help in this regard. There is a C example of using this routine on the V8 freeware CD.&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Tue, 25 Nov 2008 10:44:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142652#M43288</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2008-11-25T10:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142653#M43289</link>
      <description>Rob,&lt;BR /&gt;&lt;BR /&gt;you would need to improve the ITEMEDIT subroutine to accept a new item type (e.g. 6), which would represent the FILE_IDENTIFICATION binary string and then enhance that routine to convert this type of item to a readable ASCII string.&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Tue, 25 Nov 2008 10:51:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142653#M43289</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2008-11-25T10:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142654#M43290</link>
      <description>Unfortunately, I neither program in C++ or Fortran, which is really why I can to the list.&lt;BR /&gt;&lt;BR /&gt;Nor do I have any compilers, so I'm completely reliant on offers from people to code and compile the changes.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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!&lt;BR /&gt;&lt;BR /&gt;Rob.&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Nov 2008 11:34:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142654#M43290</guid>
      <dc:creator>Robert Atkinson</dc:creator>
      <dc:date>2008-11-25T11:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142655#M43291</link>
      <description>Rob,&lt;BR /&gt;&lt;BR /&gt;until someone picks up this 'enhancement request' and provides a solution, what do you try to do with this string ?&lt;BR /&gt;&lt;BR /&gt;Could you read that string from DCL and parse it into the various fields ? Then call F$FID_TO_NAME ?&lt;BR /&gt;&lt;BR /&gt;The FILE_IDENTIFICATION binary string seems to be in NAM$T_DVI format, i.e.&lt;BR /&gt;&lt;BR /&gt;16 byte device name&lt;BR /&gt;6 byte FILE-ID&lt;BR /&gt;6 byte DIR-ID&lt;BR /&gt;&lt;BR /&gt;See the $NAMDEF definition in SYS$LIBRARY:STARLET.REQ.&lt;BR /&gt;&lt;BR /&gt;Volker.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Nov 2008 12:00:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142655#M43291</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2008-11-25T12:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142656#M43292</link>
      <description>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.&lt;BR /&gt;&lt;BR /&gt;( &lt;A href="http://forums11.itrc.hp.com/service/forums/publicProfile.do?userId=CA1182816&amp;amp;forumId=1" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/publicProfile.do?userId=CA1182816&amp;amp;forumId=1&lt;/A&gt; )&lt;BR /&gt;&lt;BR /&gt;The bit representation would be tedious, but more importantly 3 bytes too short.&lt;BR /&gt;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).&lt;BR /&gt;&lt;BR /&gt;You may be better of TRYing to tret the umprintable as a bit string in DCL and hope is all glues together nicely.&lt;BR /&gt;Somthing LIKE...&lt;BR /&gt;&lt;BR /&gt;$id=0&lt;BR /&gt;$seq=0&lt;BR /&gt;$rvn=0&lt;BR /&gt;$id[0,16] = f$cvui(16*8,16,record)&lt;BR /&gt;$id[16,8] = f$cvui(21*8,8,record)&lt;BR /&gt;$seq[0,16] = f$cvui(18*8,16,record)&lt;BR /&gt;$rvn[0,8] = f$cvui(20*8,8,record)&lt;BR /&gt;! I could well be off by one&lt;BR /&gt;! I could well have FID(3) swapped&lt;BR /&gt;! Some of this can be expressed as string bytes, but I believe bit strings is more clear.&lt;BR /&gt;&lt;BR /&gt;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:&lt;BR /&gt;&lt;BR /&gt;$ fid    = f$file("login.com","FID") - "(" - ")"&lt;BR /&gt;$ show sym fid&lt;BR /&gt;  FID = "78215,881,0"&lt;BR /&gt;$ f_id = 'f$eleme(0,",",fid)&lt;BR /&gt;$ f_se = 'f$eleme(1,",",fid)&lt;BR /&gt;$ f_rv = 'f$eleme(2,",",fid)&lt;BR /&gt;$ show sym f_*&lt;BR /&gt;  F_ID = 78215   Hex = 00013187  Octal = 00000230607&lt;BR /&gt;  F_RV = 0   Hex = 00000000  Octal = 00000000000&lt;BR /&gt;  F_SE = 881   Hex = 00000371  Octal = 00000001561&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Nov 2008 12:34:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142656#M43292</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-11-25T12:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: C Code Returning Unreadable File ID String</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142657#M43293</link>
      <description>Went with another solution instead of ExecSymb in the end.</description>
      <pubDate>Wed, 02 Dec 2009 14:35:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/c-code-returning-unreadable-file-id-string/m-p/5142657#M43293</guid>
      <dc:creator>Robert Atkinson</dc:creator>
      <dc:date>2009-12-02T14:35:00Z</dc:date>
    </item>
  </channel>
</rss>

