home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rexxlb.zip
/
SAMPLES
/
EALIST.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-01-08
|
2KB
|
57 lines
/*****************************************************************************/
/* */
/* EALIST: Example of using REXXLIB's DOSEALIST function. Lists all */
/* extended attributes of a specified file. */
/* */
/* Requires REXXLIB (dosealist & doseasize functions) */
/* */
/* Command format: EALIST <filename> */
/* */
/*****************************************************************************/
types. = ''
types.FFFE = "length-preceeded binary"
types.FFFD = "length-preceeded ASCII"
types.FFFB = "length-preceeded bitmap"
types.FFFA = "length-preceeded metafile"
types.FFF9 = "length-preceeded icon"
types.FFEE = "length-preceeded ASCII"
types.FFDF = "multi-valued, multi-typed field"
types.FFDE = "multi-valued, single-typed field"
types.FFDD = "ASN.1 field"
say ''
parse arg file
if file = '' then do
say 'File name not specified.'
exit
end
file = strip(file)
say file 'has' doseasize(file) 'bytes of extended attributes.'
i = dosealist(file, "name.", "value.", "flags.")
if i > 0 then do
say 'There are' i "extended attributes of" file':'
say ''
do j = 1 to i
type = "Unspecified."
/* check for special types */
if length(value.j) >= 4 then do
btype = c2x(reverse(left(value.j, 2)))
if types.btype \= '' then do
type = types.btype
length.j = c2d(reverse(substr(value.j, 3, 2)))
value.j = substr(value.j, 5, length.j)
end
end
value = left(value.j, min(60, length(value.j)))
if verify(value, xrange('20'x, '7e'x)) \= 0 then
value = c2x(left(value, min(30, length(value.j))))
say "Name:" name.j '' "Flags:" c2x(flags.j) '' "Type:" type
say " Value:" value
end
end
else
say "Dosealist failed, rc =" i "on '"file"'"