Re: Determing the Size of a File
Re: Determing the Size of a File
- Subject: Re: Determing the Size of a File
- From: Paul Skinner <email@hidden>
- Date: Fri, 04 May 2001 09:43:52 -0400
>
on 5/3/01 11:32 PM, email@hidden wrote:
>
>
>> When you advise people to use "info for" to obtain the size of folders,
>
>> it
>
>> might be good to note that "info for" was broken for quite a long time
>
>> (and
>
>> may still be broken) in that it fails if you try to use it on a folder
>
>> larger than 2 GB.
>
>
>
> Hmmm, I didn't know that. I do know that it's slow on large folders.
>
> What alternatives do you suggest?
-------
NOTE: In later replies Chris Nebel clarified this as a non issue in post
1.5.5 AS.
>
>
Oh ye of little faith! This particular bug was fixed in AppleScript
>
1.5.5.
-------
>
Sorry if this has already been suggested (I have not had a chance to follow
>
this thread), but what's wrong with this?:
>
>
Tell Application "Finder"
>
-- have a folder selected in the Finder
>
-- or set an alias instead, however you like
>
size of selection
>
End Tell
>
>
I find that doing this is actually much faster to get the size of a large
>
folder than waiting for the Finder itself to do "calculate folder sizes" for
>
a window display. I actually use this in a slightly more complex script on a
>
OneClick button. You can see the whole script here:
>
>
Ken Fleisher
>
email@hidden
I find this to be within a few thousandths of a second over 1000 iterations
when a file is selected.
The thing that I find 'wrong' with this however is that when run on a
folder (and not a particularly big one)
get info for the selection--takes 0.850262 seconds for 100 iterations
size of selection--takes 66.83433 seconds for 100 iterations
Ouch!
--
Paul Skinner