I am using net::ftp in a perl script running on Windows 2000 copying files from the Windows 2000 machine to a variety of non-Windows target machines. When I put a file to these machines, the files do not get converted from the Windows end-of-line convention (cr-lf) to the target convention, thus rendering the files useless. The target systems are OpenVMS, Unix and Linux. I am setting ascii with no affect. Tracing with debug gives me:
Net::FTP=GLOB(0x1d3ccb4)<<< 220 FTP Service Ready Net::FTP=GLOB(0x1d3ccb4)>>> user foo Net::FTP=GLOB(0x1d3ccb4)<<< 331 User name foo received, please send pa +ssword Net::FTP=GLOB(0x1d3ccb4)>>> PASS .... Net::FTP=GLOB(0x1d3ccb4)<<< 230 foo logged in, directory DKA300:[foo] Net::FTP=GLOB(0x1d3ccb4)>>> TYPE A Net::FTP=GLOB(0x1d3ccb4)<<< 200 Command OK Net::FTP=GLOB(0x1d3ccb4)>>> CWD [foo.install] Net::FTP=GLOB(0x1d3ccb4)<<< 250 Working directory changed to "DKA300:[ +foo.INSTALL]" --- starting ftp of 402 files Net::FTP=GLOB(0x1d3ccb4)>>> PORT x,x,x,x,x,x Net::FTP=GLOB(0x1d3ccb4)<<< 200 PORT Command OK. Net::FTP=GLOB(0x1d3ccb4)>>> STOR cnxsockh.h Net::FTP=GLOB(0x1d3ccb4)<<< 150 ASCII transfer started for DKA300:[foo +.INSTALL]CNXSOCKH.H; Net::FTP=GLOB(0x1d3ccb4)<<< 226 File transfer completed ok
Extensive searching of the Internet does not show anyone with a similar problem, but I can't believe I am unique. This problem does not occur if I use the native Windows 2000 ftp client. I really don't want to do that, though, as net::ftp gives me a far more consistent connection in every respect other than this end-of-line conversion problem. Thank you very much for your prompt assistance. Marc

In reply to NET::FTP ASCII mode not translating end-of-lines by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.