home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / REXXEA.ZIP / EALIST.CMD next >
OS/2 REXX Batch file  |  1992-11-16  |  1KB  |  44 lines

  1. /*      Copyright Ammonoosuc Technology Inc., 1992   */
  2.  
  3. /*
  4.         This command file will display on stdout, suitable for
  5.         redirection, a list of the names of Extended Attributes
  6.         associated with a file or subdirectory.
  7. */
  8.  
  9. do while (1 = 1)
  10.    say 'Enter an existing file or subdirectory name'
  11.    pull fname rest
  12.    if length(fname) <> 0 then leave
  13. end /* do */
  14. do while (1 = 1)
  15.    say 'Is this a file or a subdirectory? Enter F or D.'
  16.    pull fdir rest
  17.    if ((length(fdir) <> 0) & ((substr(fdir,1,1) = 'F') | (substr(fdir,1,1) = 'D'))) then leave
  18. end /* do */
  19. fdir = substr(fdir,1,1)
  20. if (fdir = 'F') then do
  21.    pathname = stream(fname,'c','query exists')
  22.    if length(pathname) = 0 then do
  23.       say 'File' fname 'does not exist.'
  24.       exit
  25.    end  /* Do */
  26. end  /* Do */
  27. else pathname = fname
  28. call RxFuncAdd 'FetchEA', 'RexxEA', 'FetchEA'
  29. rcode = FetchEA(pathname,EAnames,EAstrings)
  30. if length(rcode) <> 0 then do
  31.    say 'Error message from FetchEA is' rcode
  32.    exit
  33. end  /* Do */
  34. if EAnames.0 = 0 then do
  35.    say 'There are no associated Extended Attributes.'
  36.    call RxFuncDrop 'FetchEA'
  37.    exit
  38. end  /* Do */
  39. do i = 1 to EAnames.0
  40.    say 'Extended Attribute name is ' EAnames.i
  41. end /* do */
  42. call RxFuncDrop 'FetchEA'
  43. exit
  44.