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

Re: [MacPerl] -s File Test Operator



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

Graphics files are problematic too, with previews and all the other cruft
that gets shoved in the resource fork that have nothing to do with the
graphic (or the size thereof) itself.

|>Is this a huge improvement over PBGetCatInfo?
|Well, it is simpler to get to.

I have to agree with Matthias, it's only one extra line (and it's per
file, not per piece of information).

|But, this will take
|longer than a simple -s does, especially when you are doing -s on _ ...
|should these values be cached, if possible?

I would imagine stat has to do something like a FSpGetCatInfo already,
so maybe FSpGetCatInfo (<magic value>) could just copy and return the
CatInfo struct from the last stat. On the other hand, the OS already
caches directory entries, so if you're doing any non-trivial processing
for each file, the miniscule extra cost of a FSpGetCatInfo probably won't
even be measurable.

Brian

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