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

Re: [MacPerl] Folder Size?



Thanks to both Hal Wine and Paul Schinder for replying. Since speed is not
an issue in this case, I will go with the applescript solution.

It is a good reminder that there is more than one language available and
that tasks should be done in the language best suited for the need.

Thanks again,
Scott Weaver
sweaver@bluenova.com


>} At 15:40 96-01-04, Scott Weaver wrote:
>}
>} >How do I get the real size (bytes used as given by Info) of a folder?
>}
>} Same as you would in any OS -- recurse the directory subtree and add it
>} all up. (You may have noticed the Finder doing the same when you do a
>} "Get Info" on a folder.)
>}
>} To get the size of the resource fork, use an XCMD or XFCN to give this.
>
>This may be one of those times when simply asking the Finder may be the
>best choice:
>
>$folder = "Macintosh HD:Applications:";
>$size = MacPerl::DoAppleScript(<<ENDIT);
>tell application "Finder"
>size of alias "$folder"
>end tell
>ENDIT
>print "$size\n";
>
>This gets both forks of every file in the folder in one swoop.  If you
>have lots of them to size, though, then maybe an XCMD or XFCN will give
>you a speed advantage over AppleScript.
>
>}
>} --Hal
>} Hal Wine <hal@dtor.com>     voice: 510/482-0597
>}
>}
>}
>---
>--------
>Paul J. Schinder
>NASA Goddard Space Flight Center,
>Code 693, Greenbelt, MD 20771 USA
>schinder@pjstoaster.pg.md.us