Obtaining the size of a file

John Craig jc at spl21.net
Sun Apr 22 15:18:01 EDT 2007


The ls command can access just 1 file by naming it.

JC

Stephen Barncard wrote:
> I think, at least in MacOSX, that this is just the form any 
> application gets this information', including the finder.
>
> It looks very suspiciously like the dump you get when you type  "ls 
> -l" in the terminal window. Something has to 'waste the time' getting 
> this information....be it rev, the command line or another app.
>
>> Maybe I should have said 'another lengthy function call per line'...
>> I already use a cached file list, but if I hit a folder with 
>> thousands of files in it and only need the size of 1 file in that 
>> particular folder, it seems like wasted CPU time to pull the entire 
>> folder contents.
>>
>>
>>
>> Richard Gaskin wrote:
>>> John Craig wrote:
>>>> I'm recursing through a (sometimes large) list of files and folders 
>>>> which can take a while, so I was trying to avoid another function 
>>>> call per line.
>>>
>>> A perfect case for using "the detailed files", so you can rapidly 
>>> get all of the size info for an entire directory in one call, and 
>>> the just format the info or calculate it however you need.
>>>
>





More information about the use-livecode mailing list