Re: FTP Binary , ASCII

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2004-08-22 at 17:19, littleguru wrote:
> Hello
> 
> I as reading a book related to cgi scripts , and it mentioned that we 
> shouldn't upload
> scripts through Binary mode , because they will not work .
> Would you please explain to me what is the difference between these two 
> , when is the
> best time to upload with each of them .

MS-DOS/Windows editors end all lines of text with <CR><LF> pairs, while
UNIX text uses only single <LF> characters (a.k.a. <NL> or "new line"). 

If you edit a UNIX script on a DOS system, the embedded <CR> characters
will prevent it from running correctly when it's copied over to a UNIX
system using an exact binary transfer.  When in the default ASCII
transfer mode, the ftp command line client will insert or strip carriage
return characters associated with line feeds, depending on which
direction the file is being transferred.

An equivalent way to make sure there are no embedded <CR> characters in
a UNIX script is to use the 'dos2unix' utility on it after receipt.

-- Doc 
Robert G. (Doc) Savage, BSE(EE), CISSP, RHCE | Fairview Heights, IL
Fedora Core 1 kernel 2.4.22-1.2199.nptl on P-III/M IBM Thinkpad A22p
"Perfection is the enemy of good enough."
                         -- Admiral of the Fleet Sergei G. Gorshkov



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux