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

Re: [MacPerl] -s File Test Operator



At 10.40 -0400 1998.07.21, Matthias Ulrich Neeracher wrote:
>It was an intentional decision, and I stand by it. A Perl script operating on
>platform conforming text files should be compatible, and most Mac text files
>have nonempty resource forks. It is not acceptable to break text processing
>scripts by introducing random noise into -s.

Oh, of course!  I knew there was a good reason.  Darned stupid text files.  ;-)


>Chris writes:
>>What about a module/pragma that overloaded -s?
>
>Sounds a bit tricky to implement, but otherwise, why not?

I don't even know if I can do that.

>Yet another suggestion by Chris:
>>Maybe even a simple set of functions.
>>
>>  use Mac::Files qw(:size);
>>  $file = 'Shuck Manual';
>>  $data_fork_size = data_size($file);
>>  $res_fork_size  = res_size($file);
>>  $total_size     = total_size($file);
>
>Is this a huge improvement over PBGetCatInfo?

Well, it is simpler to get to.

>How about defining some
>convenience member functions of CatInfo instead?

Potato potahto.  :)  Actually, I do think this deserves some more thinking.
The simplest way, I think, is some simple functions; that clutters up the
namespace, but adding methods to CatInfo (which would have to be called
anyway) is cleaner behind the scenes, if not up front.  But, this will take
longer than a simple -s does, especially when you are doing -s on _ ...
should these values be cached, if possible?  Should extra fields be added
to File::stat, for more convenience?

I don't know.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch