home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / pibterm / pibt41e3.zip / SENDZMOD.SCR < prev    next >
Text File  |  1988-02-26  |  5KB  |  101 lines

  1. ***************************************************************************
  2. *       S E N D Z M O D . S C R --- Script interfacing DSZ to PibTerm     *
  3. ***************************************************************************
  4. *                                                                         *
  5. *    Script:  SendZMod.Scr                                                *
  6. *                                                                         *
  7. *    Purpose: Interfaces external Zmodem driver program DSZ.COM           *
  8. *             to PibTerm for sending files.                               *
  9. *                                                                         *
  10. *    Invocation:                                                          *
  11. *                                                                         *
  12. *       Execute "SendZmod"                                                *
  13. *                                                                         *
  14. *    Remarks:                                                             *
  15. *                                                                         *
  16. *       This script is designed to be automatically invoked by the        *
  17. *       <ALT>R command when Zmodem has been defined as an external        *
  18. *       protocol at <ALT>P, F)ile transfer, k) external file transfers.   *
  19. *                                                                         *
  20. ***************************************************************************
  21. *                                                                         *
  22. *                                  File spec for files to transfer
  23.    Declare  FileSpec String
  24. *                                  Baud rate for transfer
  25.    Declare BaudRate String
  26. *                                  Comm port number
  27.    Declare Port     String
  28. *                                  Zmodem block size
  29.    Declare Block    String
  30. *                                  Build DSZ invocation line in this
  31.    Declare Zmodem   String
  32. *                                  'restrict ' for host mode, else null
  33.    Declare Restrict String
  34. *                                  Host mode flag
  35.    Declare HostMode String
  36. *                                  Saves drive/directory we're in now
  37.    Declare CurDrive String
  38.    Declare CurDir   String
  39. *                                  Host mode download directory =
  40. *                                  directory remote callers can download from.
  41.    Declare UpDir    String
  42. *                                  Length of directory name
  43.    Declare L        Integer
  44. *                                  Get port number
  45.    GetParam 'PO' Port
  46. *                                  Get baud rate
  47.    GetParam 'BA' BaudRate
  48. *                                  Get Zmodem block size
  49.    GetParam 'ZB' Block
  50.    Set Block = '50'
  51. *                                  Get file spec
  52.    GetParam 'FN' FileSpec
  53. *                                  Get host mode flag
  54.    GetParam 'HP' HostMode
  55. *                                  Get directory we're in now
  56.    GetDir CurDrive CurDir
  57. *                                  If host mode, move to host mode
  58. *                                  download directory and set restrict.
  59.    Set Restrict = ''
  60. *
  61.    IF ( HostMode <> ' ' ) THEN
  62. *
  63.       GetParam 'HD' UpDir
  64. *                                  Strip final '\' if any from download dir
  65.       Set L = LENGTH( UpDir )
  66. *
  67.       IF ( Substr( UpDir, L, 1 ) = '\' ) THEN
  68.          Set UpDir = Substr( UpDir, 1, L - 1 )
  69.       ENDIF
  70. *                                  Move to download dir
  71.       ChDir UpDir
  72. *                                  Set restrict if not super-user
  73.       IF ( HostMode <> 'S' ) THEN
  74.          Set Restrict = 'restrict '
  75.       ENDIF
  76. *
  77.    ENDIF
  78. *                                  Build DSZ invocation line
  79. *
  80.    Set Zmodem = CONCAT( 'DSZ port ' , Port )
  81.    Set Zmodem = CONCAT( CONCAT( Zmodem , ' speed '  ), BaudRate )
  82.    Set Zmodem = CONCAT( CONCAT( Zmodem , ' d z pL' ), Block )
  83.    Set Zmodem = CONCAT( CONCAT( CONCAT( Zmodem , Restrict ), ' sz ' ), FileSpec )
  84. *
  85. *                                  Echo built line to screen
  86.    Writeln " "
  87.    Writeln "Invoking DSZ as follows:"
  88.    Writeln Zmodem
  89.    Writeln " "
  90. *                                  Echo Zmodem line to capture file
  91. *
  92.    Writelog "Invoking DSZ as follows:"
  93.    Writelog Zmodem
  94. *                                  Call DSZ
  95.    Dos Zmodem
  96. *                                  Return to original directory if host mode
  97.    IF ( HostMode <> ' ' ) THEN
  98.       Set CurDir = CONCAT( CONCAT( CurDrive , ':\' ), CurDir )
  99.       Chdir CurDir
  100.    ENDIF
  101.