- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- C Code Returning Unreadable File ID String
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 08:41 AM
11-24-2008 08:41 AM
FILE_IDENTIFICATION
␊_$1$DGA151ú#Md-
Anybody know the code to return it in the (n,n,n) format?
Rob.
C
C Look at the identification of the file being processed. Strip off the
C device name, and get the fileid and directory id values.
C
STREAM(NSTREAM).ENTRY=LONG(MESSAGE(IP:IP+3))
IP=STREAM(NSTREAM).POS(SMBMSG$K_FILE_IDENTIFICATION)
STREAM(NSTREAM).DEVICE_NAME_LEN=BYTE(MESSAGE(IP:IP))
STREAM(NSTREAM).DEVICE_NAME=MESSAGE(IP+1:IP+15)
STREAM(NSTREAM).FID(1)=WORD(MESSAGE(IP+16:IP+17))
STREAM(NSTREAM).FID(2)=WORD(MESSAGE(IP+18:IP+19))
STREAM(NSTREAM).FID(3)=WORD(MESSAGE(IP+20:IP+21))
DID(1)=WORD(MESSAGE(IP+22:IP+23))
DID(2)=WORD(MESSAGE(IP+24:IP+25))
DID(3)=WORD(MESSAGE(IP+26:IP+27))
C
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 09:18 AM
11-24-2008 09:18 AM
Re: C Code Returning Unreadable File ID String
printf ("%s(%d,%d,%%)\n", device, did[1], did[2], did[2])
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.
See layout in the RMS NAMDEF.
Uage example for that:
i = atoi (argv[1]);
nam.nam$w_fid_num = (short) i;
nam.nam$b_fid_nmx = (unsigned char) (i >> 16);
nam.nam$w_fid_seq = (short) atoi ( argv[2] );
nam.nam$w_fid_rvn = (short) atoi ( argv[3] );
Enjoy,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 11:55 AM
11-24-2008 11:55 AM
Re: C Code Returning Unreadable File ID String
I don't see how the listed code lines can return this:
FILE_IDENTIFICATION
â _$1$DGA151⠤⠤⠤⠤⠤ú#M⠤⠤d-⠤⠤
Do you?
Hint...show us the code that produced the lines above.
/Guenther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 01:15 PM
11-24-2008 01:15 PM
Re: C Code Returning Unreadable File ID String
Uh, comments which have a "C" in column one
are not usually described as "C code".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 01:45 PM
11-24-2008 01:45 PM
SolutionMaybe you could post an example with your formatting code? Put hardcoded values into the FID fields for illustration.
Here's an example in MACRO32 showing how to format a FID from a NAM block.
.TITLE FormatFid
.PSECT data,RD,WRT,NOEXE
$NAMDEF
MyNAM: $NAM
BinFid: .WORD 14426 ; FID (79962,17,0)
.WORD 17
.BYTE 0
.BYTE 1
outstr: .ASCID /12345678901234567890/
fmtstr: .ASCID /(!UL,!UW,!UB)/
.PSECT code,RD,NOWRT,EXE
.ENTRY start,^M
; first set up the NAM block with our canned FID
MOVC3 #NAM$S_FID,BinFid,MyNAM+NAM$R_FID_FIELDS
; Calculate NUM from FID_NUM and FID_NMX
MOVZBL MyNAM+NAM$B_FID_NMX,R2
ASHL #16,R2,R2
MOVW MyNAM+NAM$W_FID_NUM,R2
$FAO_S ctrstr=fmtstr outlen=outstr outbuf=outstr -
p1=R2 p2=MyNAM+NAM$W_FID_SEQ p3=MyNAM+NAM$B_FID_RVN
; display result
PUSHAB outstr
CALLS #1,G^LIB$PUT_OUTPUT
RET
.END start
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 02:03 PM
11-24-2008 02:03 PM
Re: C Code Returning Unreadable File ID String
But look at all those C's!
(You're no fun.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2008 12:07 AM
11-25-2008 12:07 AM
Re: C Code Returning Unreadable File ID String
Thanks for the good laugh !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2008 01:25 AM
11-25-2008 01:25 AM
Re: C Code Returning Unreadable File ID String
I've attached the original code, taken from http://vms.process.com/scripts/fileserv/fileserv.com?EXECSYMB
There's actually a section in the code which says :-
C
C Item conversion information
C
C Each item has an item name, the length of the name, and an item
C conversion type, used for converting the item value to ASCII for
C streams requiring ASCII-format item values. The following table
C lists the possible item types:
C type meaning
C ---- -------
C 1 No translation (already ASCII, or item not easily
C translated to ASCII, so left in original form)
C 2 Binary longword, converted to hexadecimal in the
C format "%Xnnnnnnnn"
C 3 Date and time, converted to dd-mmm-yyyy hh:mm:ss.cc
C format (with one space between date and time)
C 4 UIC, converted to [gggggg,mmmmmm] format with octal
C group and member numbers containing leading zeroes.
C 5 Bitstring, converted to a list of which bits are
C set. Up to 16 bytes of data can be included in the
C item (since the CHARACTERISTICS item is 16 bytes long.)
C The list is a series of decimal numbers separated by
C commas (e.g. hex 641 becomes "0,6,9,10")
C
Perhaps it's simply a case of defining FILEID as a type '5'? :-
DATA SMBITEM(SMBMSG$K_FILE_IDENTIFICATION) /'FILE_IDENTIFICATION'/
DATA SMBITEMLEN(SMBMSG$K_FILE_IDENTIFICATION) /19/
DATA SMBITEMTYPE(SMBMSG$K_FILE_IDENTIFICATION) /1/
Rob.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2008 02:44 AM
11-25-2008 02:44 AM
Re: C Code Returning Unreadable File ID String
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.
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.
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2008 02:51 AM
11-25-2008 02:51 AM
Re: C Code Returning Unreadable File ID String
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.
Volker.