發信人:thyang.bbs@ibmdb2.cc.nctu.edu.tw (REXX) 日期:29 Jun 1996 09:10:32 GMT 標題:[REXX] 顯示 EA 的內容 信群:tw.bbs.comp.os2 看板:OS2 代號:<3DNWG8$y8_@ibmdb2.cc.nctu.edu.tw> 組織:交通大學 DB2 Supporting BBS [本文轉載自 REXX 討論區] Posted By: thyang (REXX) on board 'REXX' Title: [REXX] 顯示 EA 的內容 Date: Sat Jun 29 17:08:03 1996 轉載一個抓來的程式,可以顯示檔案所附的 EA 內容。TEXT Mode 的。 =================== ealist.cmd ============================================ /*****************************************************************************/ /* */ /* Home location is http://ftp.cfsrexx.com/pub. */ /* */ /* EALIST: Example of using REXXLIB's DOSEALIST function. Lists all */ /* extended attributes of a specified file. */ /* */ /* Requires REXXLIB (dosealist & doseasize functions) */ /* */ /* Command format: EALIST */ /* */ /*****************************************************************************/ call RxFuncAdd 'RexxLibRegister', 'rexxlib', 'rexxlibregister' call RexxLibRegister 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"'" =========================== The End ======================================== -- * Origin: ● 交通大學 DB2 Supporting BBS ● From: 140.113.20.152 .