file size

Alex Tweedly alex at tweedly.net
Mon Sep 22 19:23:02 EDT 2014


On 22/09/2014 22:29, larry at significantplanet.org wrote:
> Hello,
>
> I know I can use:
> put the files into field "Current Files"
>
> to get the size of a file (in bytes), but is there any way to use "answer file" or some other way to get the size of just one specific file?
>
>
You could always do  (typing into email, untested ...)
    put shell("ls -l " & theFileInQuestion) into temp
and then parse temp to get the size out.
If the filename could contain special characters (e.g. spaces) then you 
would need to add some extra level of quotes.

So it would be easier (and almost certainly faster) to do
    put the detailed files into temp
    filter temp with "*" & theFileInQuestion & "*")
and then parse that.

-- Alex.




More information about the use-livecode mailing list