home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / mr2i162a.zip / MKFINDEX.CMD < prev    next >
OS/2 REXX Batch file  |  1998-12-01  |  1KB  |  58 lines

  1. /* ============================================================= */
  2. /* ============================================================= */
  3. call RxFuncAdd SysLoadFuncs,RexxUtil,SysLoadFuncs
  4. call SysLoadFuncs
  5.  
  6. parse arg accountName
  7.  
  8. if length(accountName) < 1 then
  9.     accountName = 'mail'
  10.  
  11. call SysFileTree accountName'\f*', 'file', 'D'
  12.  
  13. filename = accountName'\folders.ndx-new'
  14. 'del 'filename' >nul 2>nul'
  15.     
  16. idir = -1
  17. i = 1
  18. do while i <= file.0
  19.     pos = lastpos('\',file.i)
  20.     if pos = 0 then
  21.         pos = lastpos(' ',file.i)
  22.     fname = substr(file.i,pos+1)
  23.    
  24.     path = fname
  25.     fname = accountName'\'fname'\folder.ndx'
  26.     say fName
  27.    
  28.     rc = SysGetEA(fname, ".LONGNAME", "eainfo")
  29.    
  30.     if rc = 0 then do
  31.         pos = lastpos("00"x,eainfo) + 1
  32.         longname = substr(eainfo,pos)
  33.     end
  34.     else longname = ""
  35.    
  36.     rc = SysGetEA(fname, "MR2I.FOLDERINFO", "eainfo")
  37.    
  38.     folderLine = ""
  39.     if rc = 0 then do
  40.         pos = lastpos("00"x,eainfo) + 1
  41.         folderLine = substr(eainfo,pos)
  42.     end
  43.     
  44.     if length(folderLine) < 5 then do
  45.         if length(longname) > 0 then
  46.             folderLine = longname
  47.         else folderLine = path
  48.         folderLine = folderLine''path''path'N0'
  49.     end
  50.     rc = lineout(filename,folderLine)
  51.    
  52.     i = i + 1
  53. end
  54.  
  55. return 0
  56.  
  57.  
  58.