Re: FTP Binary , ASCII

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

 



On Sun, Aug 22, 2004 at 10:42:41PM -0500, Mike Burger wrote:
> On Sun, 22 Aug 2004, littleguru wrote:
> 
> > 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 .
> 
> Whomever told you that, told you wrong.  The reverse is actually true.  
> Uploading in ASCII mode can cause your scripts to not work, properly, in 
> that it's possible that you'll have line end/feeds added/removed/changed 
> for each line.
> 
> Uploading in Binary mode transmits the file, as is, to the destination 
> system.  If a script file fails to run, after uploading in binary mode, 
> then it's either got issues, already, or its file permissions aren't 
> correctly set.

True binary transmits the file exactly and  99 44/100% of the time
that is what is wanted.

In some cases there is a desire to make the newline conversion as part
of the transfer process.  This is sometimes needed when editing on
non Unix style systems (WindowZ) and executing on unix/Linux.

Recently client/server pairs have gotten clever and do this conversion
on the fly. Perhaps this is because so many windows desktops are used
to edit content that is then uploaded to Linux.  RTFM on the daemon on
the Linux side and experiment.  

This is new functionality to an old unix guy like me.  I was
pleasantly supprised to see that this was done by vs-ftp. I was also
pleases by how much control the system manager had.  Since the Linux
community has multiple ftp choices this detail can be site dependant.

My old school preference is to make the converions with tools like tr,
vim, dos2unix and mac2unix and use binary to transfer exactly what I have.

When stuck on a windows box I like cygwin tools like these.

   http://sources.redhat.com/cygwin/cygwin-ug-net/using-effectively.html

   ...
   "One of the hassles of Unix-Windows interoperability is the
   different line endings on text files. As mentioned in the Section
   called Text and Binary modes, Unix tools such as tr can convert
   between CRLF and LF endings, but cygutils provides several
   dedicated programs: conv, d2u, dos2unix, u2d, and unix2dos. Use the
   --help switch for usage information.:
   ....

In fact this little problem should be one of the errors in the shell
programming homework assignment we were given.  However the
instructions give away solutions to the problem.

Of interest some scripting languages mostly do not care....

-- 
	T o m  M i t c h e l l 
	Just say no to 74LS73 in 2004



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

  Powered by Linux