Re: [MacPerl-Porters] default type/creator

[email protected] (Bart Lateur)
Newsgroups perl.macperl.porters
Organization MediaMind
Message-ID <[email protected]>
On Thu, 25 Oct 2001 08:04:57 -0400, Chris Nandor wrote:

>>I tend to agree that, when a file is transferred as text, the default
>>type may well be text, but when transferred as binary, it should be some
>>binary type, definitely not text.
>
>There's no way to handle that in MacPerl itself, that I can think of.  It
>has to be in the perl code doing the downloading.

But it makes an interesting philosophical question. So we have these
additions we'd like to put into Net::FTP, but only for Mac. So where do
we put it?

 A) We make a new wrapper module, say, Net::FTP::Mac, which you have to
use instead of Net::FTP, and which is mainly a wrapper around it. With
OO, this shouldn't be hard, but if there's a API for plain function
calls, this would be a more "interesting" exercise.

 B) We insert hooks into the standard Net::FTP, which could call out for
platform specific extensions, something along the lines of File::Spec.

The kind of extensions I'm thinking about here: you could go look in a
list of file extensions and see if a file needs to be transferred as
text, or a binary (which would be the default), like WS_FTP does. For
Mac, you have the default creator and file type. For the Mac, you'd use
Internet Config, but not on the other platforms.

I must say that from an implementor's point of view, I like A, because
it would leave the original Net::FTP alone. But from a user's point of
view, I prefer B, because A would make your user program platform
dependent. Perhaps there's another way: an invisible wrapper around the
original Net::FTP? No, that's yucky.

-- 
	Bart.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.