FTP doesn't add Carriage Return from VMS to NT?

Discussion in 'Perl Misc' started by Mike O'Neal, Aug 8, 2003.

  1. Mike O'Neal

    Mike O'Neal Guest

    When I try to use NET::FTP to transfer text files from VMS to NT (GET
    command using ASCII mode,) FTP will add the Linefeed, but not the
    required carriage return. As is clearly stated all over the
    newsgroup, NT/2000 requires the CR/LF at the end of each line. VMS
    uses neither. Side-note, when I transfer the files in binary, NO line
    terminations are added, as expected. I'm using Windows 2000 with the
    ActiveState Perl vers 5.8. I've reloaded the W2k system and Perl with
    the same results.

    I've located what appears to be the module that performs the transfer
    at perl\lib\net\ftp\A.pm but it seems to substitute \n with 015 and
    012. I would have expected 013 and 010 (decimal for CR/LF) so now I'm
    really confused. Changing them makes no difference, so I guess I'm
    way off base.

    Anyone have suggestions why I'm not getting my CR/LF as expected?
     
    Mike O'Neal, Aug 8, 2003
    #1
    1. Advertising

  2. <snip>
    > Anyone have suggestions why I'm not getting my CR/LF as expected?


    I posted a suggestion on this issue within the last 3 weeks. Plus,
    someone else responded that the issue appears to lie with W2K.

    The thread has the subject:
    FTP in ASCII mode from UNIX to NT

    Same type of issue - line endings fouled.

    HTH

    Jim
     
    James Willmore, Aug 9, 2003
    #2
    1. Advertising

  3. Mike O'Neal

    Mike O'Neal Guest

    James Willmore <> wrote in message news:<>...
    > <snip>
    > > Anyone have suggestions why I'm not getting my CR/LF as expected?

    >
    > I posted a suggestion on this issue within the last 3 weeks. Plus,
    > someone else responded that the issue appears to lie with W2K.
    >
    > The thread has the subject:
    > FTP in ASCII mode from UNIX to NT
    >
    > Same type of issue - line endings fouled.
    >
    > HTH
    >
    > Jim


    Jim, I read your issue, and if it's notepad you need to read it in,
    just use Wordpad! Voila, problem solved, since it is content to use
    LF as a terminator. My problem is proprietary software that NEEDS the
    expected CR/LF. I know I can post-process the files, but there's a
    bunch and I'd like a better solution if possible.

    Does anyone know if the "A" module I mention above is the right place,
    or perhaps elsewhere?
     
    Mike O'Neal, Aug 10, 2003
    #3
  4. Mike O'Neal

    Jay Emm Dee Guest

    I hope the confusion over 012 and 015 v. 10 and 13 has been
    cleared up. They sre both values for CR and LF - in octal and
    decimal.

    Mike O'Neal wrote:
    > James Willmore <> wrote in message news:<>...
    >
    >><snip>
    >>
    >>>Anyone have suggestions why I'm not getting my CR/LF as expected?

    >>
    >>I posted a suggestion on this issue within the last 3 weeks. Plus,
    >>someone else responded that the issue appears to lie with W2K.
    >>
    >>The thread has the subject:
    >>FTP in ASCII mode from UNIX to NT
    >>
    >>Same type of issue - line endings fouled.
    >>
    >>HTH
    >>
    >>Jim

    >
    >
    > Jim, I read your issue, and if it's notepad you need to read it in,
    > just use Wordpad! Voila, problem solved, since it is content to use
    > LF as a terminator. My problem is proprietary software that NEEDS the
    > expected CR/LF. I know I can post-process the files, but there's a
    > bunch and I'd like a better solution if possible.
    >
    > Does anyone know if the "A" module I mention above is the right place,
    > or perhaps elsewhere?
     
    Jay Emm Dee, Aug 12, 2003
    #4
  5. On Mon, Aug 11, Jay Emm Dee blurted out atop a fullquote:

    > I hope the confusion over 012 and 015 v. 10 and 13 has been
    > cleared up.


    I didn't see any such confusion anywhere in what you quoted.

    I'd say that whatever confusion there might have been before you
    posted, could only have been made worse by your posting.

    The killfile awaits.
     
    Alan J. Flavell, Aug 12, 2003
    #5
  6. Mike O'Neal

    Mike O'Neal Guest

    I have the solution, at least for my situation! This fix comes with
    no warranty, expressed, implied or otherwise, but for those who
    experience the problem I related (carefully go back and read my
    original problem,) this seems to resolve it. I have only tried this
    with version 5.8.0, so it may work differently or not at all with
    other versions. It may not even work with this version, so don't
    trust me...

    Locate the A.pm module in the perl\lib\net\FTP directory on the pc.
    Comment out the (octal) substitution line (it's the only one like it)
    as follows:

    # $readbuf =~ S/\015\012/\n/sgo;

    It appears that this substitution is not needed and is causing the
    trouble. I can now transfer ASCII files from VMS systems to my Win2K
    box, and the CORRECT CR/LF is present on the Windows systems. Hurah!
    Remember, use this fix at your own risk, since I don't know what I'm
    talking about.
     
    Mike O'Neal, Aug 12, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. C
    Replies:
    1
    Views:
    349
    John Saunders
    Aug 28, 2003
  2. Xeno Campanoli
    Replies:
    0
    Views:
    247
    Xeno Campanoli
    Feb 13, 2006
  3. Steve Anderson
    Replies:
    3
    Views:
    282
    Steve Anderson
    Jun 21, 2004
  4. D. Buck
    Replies:
    2
    Views:
    598
    D. Buck
    Jun 29, 2004
  5. Geoff Cox

    add carriage return?!

    Geoff Cox, Sep 13, 2005, in forum: Javascript
    Replies:
    9
    Views:
    135
    Geoff Cox
    Sep 14, 2005
Loading...

Share This Page