home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / cko191.zip / xsend.cmd < prev   
OS/2 REXX Batch file  |  1994-07-16  |  3KB  |  74 lines

  1. /* XSEND.CMD - A C-Kermit Rexx program to transmit an entire            */
  2. /*             directory tree from one computer to another.             */
  3. /*                                                                      */
  4. /* Alias: CKOXSE.CMD.                                                   */
  5. /* Author: Jeffrey Altman - Altmania Productions                        */
  6. /* Version 2, July 16, 1994                                             */
  7. /*                                                                      */
  8. /* Format:                                                              */
  9. /*  XSEND <PATH> <FILESPEC>  e.g., XSEND C:\\ *                         */
  10. /*  (Note: backslashes must be doubled.)                                */
  11. /*                                                                      */
  12. /* To send an entire directory tree from one OS/2 System to another:    */
  13. /*                                                                      */
  14. /* REMOTE                                                               */
  15. /*  set file type labeled                                               */
  16. /*  set file collision update                                           */
  17. /*  server                                                              */
  18. /*                                                                      */
  19. /* LOCAL                                                                */
  20. /*  define xsend rexx call xsend.cmd '\%1 \%2'                          */
  21. /*  set file type labeled                                               */
  22. /*  xsend <path> <filespec>                                             */
  23. /*  finish                                                              */
  24. /*                                                                      */
  25. /* CAUTION: The above procedure is not recommended for sending from an  */
  26. /* HPFS volume to a FAT volume.  Any other combination is OK.           */
  27. /*                                                                      */
  28. /* You can also XSEND from OS/2 to DOS or UNIX, but you should use      */
  29. /* BINARY rather than LABELED mode.  When sending to UNIX in this way,  */
  30. /* the resulting text files will still be in OS/2 format (CRLF rather   */
  31. /* than LF line terminators).  You should only XSEND to DOS from a      */
  32. /* FAT volume.                                                          */
  33. /*                                                                      */
  34. /* Homework:  Modify this program for sending directory trees to VMS.   */
  35. /* Hints: "mkdir" -> "create/dir", "cd .." -> "cd [-]", etc.            */
  36. /*                                                                      */
  37. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  38. call SysLoadFuncs
  39.  
  40. PARSE ARG path filespec
  41.  
  42. IF path = "" | filespec = "" THEN DO
  43.    SAY "XSEND <path> <filespec>"
  44.    RETURN 
  45. END
  46.  
  47. SAY "Sending all files" filespec "in directory tree" path "to the Server"
  48.  
  49. call XSEND path, filespec
  50. RETURN
  51.  
  52. XSEND: PROCEDURE 
  53. path = ARG(1) 
  54. filespec = ARG(2) 
  55.  
  56. startdir = DIRECTORY( path ) 
  57.  
  58. call SysFileTree filespec, 'file', 'FO'
  59. do i=1 to file.0
  60.   'send' FILESPEC('name',file.i)
  61.   end
  62.  
  63. call SysFileTree '*', 'dir', 'DO'
  64. do i=1 to dir.0
  65.   directory = FILESPEC('name',dir.i)
  66.   'remote host mkdir' directory
  67.   'remote cd'         directory
  68.   call XSEND directory, filespec
  69.   'remote cd ..'
  70.   end
  71.  
  72. call DIRECTORY startdir 
  73. RETURN 
  74.