home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / lfncall.zip / LFNCALL.CMD < prev    next >
OS/2 REXX Batch file  |  1997-09-26  |  2KB  |  70 lines

  1. /*
  2.  * LFNCall V 1.4
  3.  *
  4.  * Hilfsprogramm zum Umkopieren der Langnamendateien
  5.  * zum Bearbeiten und zum Zurückkopieren
  6.  * (c) 1997 Thomas Bohn, Vogelwiese 65, D-18435 Stralsund, Germany
  7.  *
  8.  */
  9.  
  10. call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree'
  11.  
  12. '@Echo off'
  13. 'cls'
  14. say''
  15. say'     ┌───────────────────────────────────────────────────────────────────┐'
  16. say'     │                             LFNCall V 1.4                         │'
  17. say'     │                        (c) Thomas Bohn 1997                       │'
  18. say'     │                      Langnamen-Kopierprogramm                     │'
  19. say'     └───────────────────────────────────────────────────────────────────┘'
  20. say''
  21.  
  22. parse arg Command Par
  23. if Par=="" then exit
  24. nLZPos=lastpos(' ',Par)
  25. File1=left(Par,nLZPos-1)
  26. File2=right(Par,length(Par)-nLZPos)
  27.  
  28. SELECT
  29.  WHEN Command=='/K' then do
  30.    say "Kopiere Langnamen-Datei zum Bearbeiten in temp. Verzeichnis..."
  31.    say "Copying file with long name to temp. directory..." 
  32.    Copy File1 File2
  33.  end
  34.  WHEN Command=='/L' then do
  35.    Dir1='lfndir1.dat'
  36.    Dir2='lfndir2.dat'
  37.    'dir /N' File1 '>'Dir1
  38.    'dir /N' File2 '>'Dir2
  39.    Line1= LineIn(Dir1,1,1)
  40.    Line1= LineIn(Dir1,,1)
  41.    Line1= LineIn(Dir1,,1)
  42.    Line1= LineIn(Dir1,,1)
  43.    Line1= LineIn(Dir1,,1)
  44.    if substr(Line1,1,1) == " " then Line1= LineIn(Dir1,,1)
  45.    call stream Dir1, "C", "CLOSE"
  46.    Line2= LineIn(Dir2,1,1)
  47.    Line2= LineIn(Dir2,,1)
  48.    Line2= LineIn(Dir2,,1)
  49.    Line2= LineIn(Dir2,,1)
  50.    Line2= LineIn(Dir2,,1)
  51.    Line2= LineIn(Dir2,,1)
  52.    call stream Dir2, "C", "CLOSE"
  53.    if substr(Line1,1,26) <> substr(Line2,1,26) then do
  54.       say "Kopiere veränderte Datei zurück..."
  55.       say "Copying changed to original position..."
  56.       Copy File2 File1
  57.       call SysFileTree File1 'Test', 'T'
  58.       if (Test.0<>0) then del File2
  59.    end
  60.    else do
  61.     say "Datei unverändert - keine Aktion."
  62.         say "file unchanged - no action."
  63.     del File2
  64.    end
  65.    del Dir1
  66.    del Dir2
  67.  END
  68. end
  69. exit
  70.