1834007 Members
2015 Online
110063 Solutions
New Discussion

FTP in ASCII mode

 
SOLVED
Go to solution
Ed Hon
Regular Advisor

FTP in ASCII mode

I had an HP-UX log file (text), which I ftp'd to a Windows NT PC, once in binary mode and once in ascii mode. Using a Windows text viewer, the binary mode file appeared all jammed up, which I expected. The ascii mode file appeared neat and clean like a report. What is ascii mode looking for in the byte stream to convert and how does it know how to convert it?
4 REPLIES 4
Helen French
Honored Contributor

Re: FTP in ASCII mode

May be Bill's answer in this thread will help you:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x8d0f8f960573d611abdb0090277a778c,00.html

Life is a promise, fulfill it!
John Palmer
Honored Contributor

Re: FTP in ASCII mode

Hi Ed,

The main difference is that Windows uses the two byte sequence of CR LF to indicate end of record, UNIX uses the single byte LF.

Windows therefore thinks that a UNIX file is a single record - hence the 'jammed up' appearance.

Regards,
John
Stefan Farrelly
Honored Contributor
Solution

Re: FTP in ASCII mode


Unix files always use EOL characters (the LF character) for each line termination while DOS ASCII files will have CR and LF at the end of each line.

You can use the dos2ux and ux2dos commands can produce either form.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Rory R Hammond
Trusted Contributor

Re: FTP in ASCII mode

If you Wordpad instead of notepad the binary version will look ok. MS wordpad appears to be angnostic about cr/lf lf or cr.

Rory
There are a 100 ways to do things and 97 of them are right