|
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]
|