HP ARPA File Transfer Protocol User's Guide
> Chapter 6 MPE/iX File System and Data TransfersFile Transfer Examples |
||||||||||||||||||||||||
|
Variable Record FilesThe first example in Figure 6-1 "ASCII Transfer" shows an FTP user on MPE/iX transferring an ASCII file to a UNIX system then retrieving the file with the original record structure intact. AFILE is stored with the attributes: REC=-80,1,V,ASCII. AFILE can contain records of up to 80 characters. The records are of variable length. The file transfer is performed: (1) ftp> ascii ftp> put afile xxfileThe UNIX file system stores the data in a contiguous stream, separated by carriage return characters (<cr>). To retrieve the file as it was originally stored, the MPE/iX FTP user can do the following: (2) ftp> ascii ftp> get xxfile xxfile;rec=-80,1,v,asciiFigure 6-1 ASCII Transfer Mixed Mode TransferIf you transfer an ASCII type file in binary mode, you may not be able to retrieve the file in its original form as pictured in Figure 6-2 "Mixed Mode Transfer". An MPE/iX ASCII file, AFILE, transferred to the UNIX system using FTP binary transfer mode results in a file of contiguous data on the UNIX system. Note that record structure is not maintained in binary transfers. (1) ftp> binary ftp> put afle yyfileWhen the user tries to retrieve the file using file building parameters (rec=-80,1,v,ascii), the file is retrieved as one record (since the total amount of data is less than 80 bytes). (2) ftp> binary ftp> get yyfile yyfile;rec=-80,1,v,asciiFigure 6-2 Mixed Mode Transfer Fixed Record FilesTransferring files that contain imbedded carriage return-line feed characters (<cr> <lf>) can be a problem if you try to transfer these files in ASCII mode. In FTP ASCII transfer mode, the remote system interprets a carriage return-line feed pair (<cr> <lf>) as a new record. One method of transferring a fixed file to a remote system then retrieving it with the data and record structure intact is pictured in Figure 6-3 "Fixed Record Transfer". An MPE/iX FTP user transfers an ASCII file with fixed length records of 132 bytes long to a UNIX system in FTP binary mode as follows: (1) ftp> binary ftp> put FXFILE uxfileOn the UNIX system, the file is stored as a contiguous stream, including the spaces. To retrieve the file and maintain the original record structure, the MPE/iX user must use the GET command with the following build parameters: (2) ftp> binary ftp> get uxfile uxfile;rec=-132,,f,asciiFigure 6-3 Fixed Record Transfer
|