jlocigno has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to convert an existing FTP process that uses Korn Shell ftp scripting over to Perl Net::FTP. I can easily get it working but in the process I discovered something interesting. The current process (Korn Shell script) uses the command "STRUCT RECORD". After talking with the original programmer of this code, I was told that it was there to preserve trailing spaces when doing an ascii transfer (MOST of our files come from and MVS system). This is all fine and good but the code uses STRUCT RECORD for ascii AND binary transfers. When it uses it for binary transfers the number of bytes transferred is MUCH greater then the actual number of bytes for the file and the transfer can take almost twice as long as it does without using STRUCT RECORD. I have searched the web and google and even looked at some RFC info but can not find any statment as to what STRUCT REORD does. I have this theory that is NOT necessary for binary transfers and in fact considerably slows them done. 1) Does anybody know if my thery is correct. 2) Where can I find information as to what STRUCT RECORD does? Thanks Jim Locigno

Replies are listed 'Best First'.
Re: STRU RECORD and FTP?
by blazar (Canon) on Sep 14, 2005 at 10:31 UTC
    1. I don't have the slightest idea what STRUCT RECORD could be,
    2. no, I don't think it's necessary,
    3. I feel like suggesting you to use Net::SFTP to transfer files, which I have used advantageously.
      Thanks for your input. I'm not sure I can use Net::SFTP - are admins have not installed Secure FTP yet (they are currently thinking about it) however right now the Net::FTP seems to work great. I accidentially found the struct record which seems to be significantly slowing down transfers (40 to 60% slower). Jim Locigno
Re: STRU RECORD and FTP?
by samizdat (Vicar) on Sep 14, 2005 at 12:41 UTC
    Hi, Jim - It looks like somebody was attempting to emulate a C STRUCT data format definition.

    I couldn't find anything in the man page for ksh that came with my FreeBSD-5.4 pdksh distro that looks anything like what you describe.

    Check first for a macro definition that generates the construct. It'll probably be a string mapping construct.

    I would seriously doubt that your Perl version needs this for either ASCII or binary transfers. Net::FTP away! :D