Re: Inconsistent results from Finder and System Events
Re: Inconsistent results from Finder and System Events
- Subject: Re: Inconsistent results from Finder and System Events
- From: kai <email@hidden>
- Date: Wed, 19 Nov 2003 02:21:22 +0000
on Tue, 18 Nov 2003 16:07:07 -0800, Christopher Nebel wrote:
>
On Nov 18, 2003, at 1:23 PM, Marc K. Myers wrote:
>
>
>> Looks like you haven't had a nibble on this one yet, Marc - so I'll
>
>> try and kick things off - by observing that the Finder returns the
>
>> value of 'capacity' as a double integer, while System Events returns
>
>> an unsigned integer...
>
>
> OMM both System Events and Finder appear to return reals for capacity
>
> and free space of disks. Or am I missing something?
>
>
Well, assuming the dictionary is telling the truth, that would explain
>
it -- the Panther version of System Events says "double integer".
>
"unsigned integer" is only 32 bits, which is only enough for 4 GB, and
>
obviously your disk is larger than that. Possible solutions: ask the
>
Finder, upgrade to Panther, or partition your disk into
>
smaller-than-4GB chunks. (Hey, it would work.)
>
>
The bit you're missing (and something I'm working to correct) is that
>
dictionaries tend to list Apple Event transport types (such as "double
>
integer", which, by the way, is a 64-bit integer), which are not quite
>
the same things as AppleScript types. Integers in AppleScript are 27
>
bits long; anything bigger than that (about 134M) gets turned into a
>
real on receipt.
I'm relieved you jumped in here when you did, Chris.
I get the same results from this in OS 10.2.8 and OS 9 (AS 1.8.3):
-----------
set l to {}
tell 512 * (2 ^ 20) - 2 as unsigned integer to repeat with n from 0 to 2
tell it + n to set l's end to {its class, it}
end repeat
l
-----------
--> {{integer, 536870910}, {integer, 536870911}, {real, 5.36870912E+8}}
---
kai
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.