At 12:34 AM 3/17/2004, Conrad Schilbe wrote:
What ever happened to portability of code.

I was just trying to answer the question as asked....


As someone else pointed out:

$size = `du -sk $dir`;

Would do the trick nicely.

Without checking it myself, I'll suggest that du might return a value that is not visually the same value to the value that the Finder shows - and when writing applications for typical Mac users this would be a bad thing.


So now, to make your app present a similar piece of data, you're rewriting a portion of the Finder's code - even if it's just reformatting numbers.

And as Ken Williams said, du may not take resource forks into account properly.

-Jeff Lowrey




On 3/16/04 7:03 AM, "Jeff Lowrey" <[EMAIL PROTECTED]> wrote:

> At 01:48 AM 3/16/2004, Rick Measham wrote:
>> I'm trying to get the size of a folder and figure Mac::Glue would be the
>> way to go. However I'm getting back a 0:
>>
>> my $size = $finder->data_size("$monthdir/$folder/");
>> print $size;
>
> From my own mistakes with Mac::Glue, I'm guessing you need to add a
> ->get() somewhere in there.
> Like
>    my $size = $finder->data_size("$monthdir/$folder/")->get();
>
> -Jeff
>
>




Reply via email to