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

M

Mike O'Neal

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?
 
J

James Willmore

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
 
M

Mike O'Neal

James Willmore said:
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?
 
J

Jay Emm Dee

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.
 
A

Alan J. Flavell

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.
 
M

Mike O'Neal

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top