You are here: Re: ascii or binary « PHP Programming Language « IT news, forums, messages
Re: ascii or binary

Posted by Jerry Stuckle on 03/14/06 14:08

Bent Stigsen wrote:
> greg wrote:
> [snip]
>
>> Thank you for these explanations.
>> In fact, I should have told why I want know make the difference
>> between ascii and binary files.
>> I have a list of files to send via FTP from a local machien to a
>> remote server.
>> the ftp_put function needs an argument that can be FTP_ASCII or
>> FTP_BINARY.
>> I don't know how to choose dynamicaly this argument as the must upload
>> various file types.
>
>
> The only purpose of ascii transfer is to translate line-endings
> (CR,LF,CRLF) between differing systems, but many text-editors can handle
> any type, so always using binary as Kimmo suggest is a good option,
> since this leaves files intact, whereas using ascii by mistake could
> render a file useless.
>
> Although I would think that to use ascii-transfer if and only if file
> has an extension of ".txt" should be safe.
>
> /Bent

Transferring a text file from Windows to Unix will cause problems in VIM
and many other Unix editors. And not all Windows editors support
Unix-style nl characters.

Better to determine if it's a text file, and only if unknown default to
binary.

Alternatively, scan the file for non-char values.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация