.ENABLE QUIET !************************ MFTP.IND for TSX+ *****************************! ! ! FTP individual file(s) (wild cards allowed) from a specified device ! Any file spec that is valid for the directory command is allowed here. ! ! Installation instructions are located at the end of this file. ! ! Ed Hendrickson, Ames Laboratory, Ames, Iowa 3/9/94 ! .sets ver "1.1" ! the current version number. KEEP THE SAME FORMAT n.n .sets verdat "01-Mar-94" ! last time updated. Keep same format .DISABLE LOWERCASE .IF P1 = "" .ASKS P1 Input file specification for FTP> .IF P1 = "" .GOTO HELP .IF P1 = "?" .GOTO HELP .; ? will go to help section .IF P1 = "HELP" .GOTO HELP .; HELP will go to help section .IF P1 = "help" .GOTO HELP .; help will go to help section .NOHELP: ! This will test to see if the switches are directly after the file ! name, or after the command. If they are after the command ! (i.e. MFTP/switch) then concatenate them after the file name. .SETS SP1 P1[1:1] .IF SP1 <> "/" .GOTO REMOVE .TEST P2 .IF = 0 .ASKS P2 Input file specification for FTP> .SETS P1 P2+P1 .Sets P2 P3 .REMOVE: ! Remove any switches from the filename. .PARSE P1 "/" SPEC S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15 S16 S17 .SETN SWINUM (-1.) .;SWINUM is the number of switches .Parse Spec ":" Device Files .TEST SPEC ":" .IF = 0 .Sets Device "DK" .;Use the default device if one is not given ! Ask the username password and subdirectory that you want to PUT to. .ASKS USRNAM username> .ASKS PASSWD password> .ASKS SUBdir Change to a SUBdir (ex: [.mydir.test] ) use brackets > .TEST SUBdir .IF = 0 .Sets SUBdir "SYS$LOGIN" ! The ask directive defaults to false if return is pressed. .sets filtyp "ASCII" .ASK [] tyflag Are all of the files ASCII (default ASCII) .iff tyflag .sets filtyp "BINARY" @Sy:Displa.Ind -- MFTP.ind - No more questions will be asked. ! Create a .lst file that contains all of the files you want to FTP. ! .OPEN WF:FTPWRK.TMP .ENABLE DATA Dir/Brief/Col:1/Out:WF:FTPWRK.LST 'SPEC' Type Wf:FTPWrk.Lst .DISABLE DATA .CLOSE $@WF:FTPWRK.TMP .Openr #1 Wf:FTPwrk.Lst .Read #1 Date .Read #1 File .If File <> "" .goto BldFTP @Sy:Displa.Ind -- MFTP.ind - No files were selected. ! Need to cleanup WF:(FTPwrk.lst,.tmp) yet. .Purge #1 .TESTFILE WF:FTPwrk.Tmp .IF = 1 DELETE/NOQ WF:FTPwrk.Tmp .TESTFILE WF:FTPwrk.Lst .IF = 1 DELETE/NOQ WF:FTPwrk.Lst .Exit .BldFTP: .Open Wf:FTPwrk.Tmp ! Process the first FTP command. ! Remove blanks between file name and extension .Parse File " " n1 n2 n3 n4 n5 n6 .Sets File n1+n2+n3+n4+n5+n6 .Data Time .Data Set TT NoQuiet .Data R uftp .Data Open Jensen .Data 'USRNAM' 'PASSWD' .Data CD 'SUBdir' .Data 'filtyp' .Data PUT 'Device':'File' 'File' .Setn Count 1 .Nextfl: .Read #1 File ! Remove all blanks between file name and extension .Parse File " " n1 n2 n3 n4 n5 n6 ! If the first character is a blank, then all files have been processed. .Sets Fstart File[1:1] .If Fstart = " " .goto DoFTP .Sets File n1+n2+n3+n4+n5+n6 .Data PUT 'Device':'File' 'File' .Inc Count .Goto NextFL .DoFTP: .Data Exit .Data Set TT quiet .Data Time .Close .Purge #1 !!! Delete Wf:FTPwrk.lst .Disable quiet ! ! 'Date' - MFTP.ind version 'ver' ! 'Count' files ('n4' blocks) have been selected for FTP transfer. .Enable Quiet $@Wf:FTPwrk.Tmp .If <> .goto done .Disable quiet ! MFTP.ind completed normally. .Enable Quiet Delete Wf:FTPwrk.Tmp .DONE: .EXIT ! ! END OF !******************************** MFTP.IND **********************************! ! MFTP.IND Documentation .HELP: .DISABLE QUIET .SETN INDEX 1. .sets hline "Version "+ver+" by Ed Hendrickson last updated "+VERdat+" Help Screen #" .HLOOP: .GOSUB PAGE'INDEX' .INC INDEX .IF INDEX > 2. .SETN INDEX 1. .ASK [] CONTIN Continue .IFF CONTIN .EXIT .GOTO HLOOP .PAGE1: !****************************** MFTP.IND ********** Help module #'INDEX' ****! ! ! ! 'HLINE''INDEX' ! ! ! ! MFTP IND is an indirect command procedure which will FTP individual ! ! files, allowing the use of wild cards as would be allowed by the ! ! directory command. ! ! ! ! ! ! To use the MFTP command procedure, copy it to the system disk, i.e, ! ! .Copy (MFTP.Ind,Displa.Ind) Sy: ! Displa.ind is used for some messages.! ! ! ! Then define the MFTP command as a user command, i.e, ! ! .MFTP :== Ind Sy:MFTP.Ind ^ ! ! .Assign VM: WF: ! Temporary files are generated on WF:FTPwrk. ! ! ! ! This will define the MFTP command and provides a place for scratch files. ! ! WF can be assigned to any direct access devide ! ! ! !***************************************************************************! ! ! ! .Return .PAGE2: !***************************** MFTP.IND *********** Help module #'INDEX' ****! ! ! ! 'HLINE''INDEX' ! ! ! ! The form of command that MFTP will allow is as follows: ! ! ! ! .MFTP : ! ! ! ! where the list of files may include wild cards and up to six file specs ! ! divided by commas. If the input device is not specified it will be DK: . ! ! ! ! Currently no switches are accepted to modify the above actions taken. ! ! ! ! Example: .MFTP Du3:(AB*,c%%,*.dat) ! ! or: .MFTP *.* ! ! or: .MFTP *.f77,*.obj,*.sav ! ! ! !***************************************************************************! .RETURN