Obtaining the size of a file

Jim Ault JimAultWins at yahoo.com
Sat Apr 21 01:40:49 EDT 2007


This does not use shell, but similar.
Another way that might help someone out there is to:

on mousedoubleup
  answer file "choose a file"
  put fileSizeK(it) && "K" into msg
end mousedoubleup

function fileSizeK pathFN
  put quote into q
  get revMacFromUnixPath(pathFN)
  get ("tell app "&q&"Finder"&q&" to return the size of alias "&q& it &q)
  do it as applescript
  return (the result div 1000)
end fileSizeK


Jim Ault
Las Vegas


On 4/20/07 5:50 PM, "John Craig" <jc at spl21.net> wrote:

> Some of the files may be very large - making this method too slow.
> 
> Mark Smith wrote:
>> Well, I guess  the detailed files actually is the native rev method,
>> but this works:
>> 
>> on mouseUp
>>   put "/Users/marksmith/Desktop/add.tiff" into tUrl
>>   put length (URL ("binfile:/Users/marksmith/Desktop/add.tiff"))
>> end mouseUp
>> 
>> Of course, it means reading the whole file into memory, which might
>> not always be ideal.
>> 
>> Best,
>> 
>> Mark
>> 
>> On 20 Apr 2007, at 23:32, John Craig wrote:
>> 
>>> Does anyone know of a native rev. method to obtain the size of a file
>>> without using shell or 'the detailed files'?
>>> 
>>> Thanks,
>>> 
>>> JC
>>> 
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>> 
>> 
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>> 
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list