Getting file size

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Getting file size

Post by Andycal » Sat Nov 14, 2009 2:45 pm

I seem to be missing a trick here. The 'files' command puts all files in a folder into a variable which I can then find the file size for, but I just want to get the file size for a file I know the name of.

Do I really need to list all the files in a directory, then find it in the array and then get the file size? Seems a bit bonkers.

I've already got the file name as the result of an 'answer' command, can't I do something like :

Code: Select all

put the filesize of tFile into tSize

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Post by RRobert » Sat Nov 14, 2009 3:27 pm


Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Post by Andycal » Sat Nov 14, 2009 5:56 pm

Blimey, great thread!

Just goes to show, there are many ways to skin this cat. Odd though, with a language that offers so many ways to do very simple things in one-liners, it's amazing it's such a faff to so something like get a file size.

Got it working now though, and I guess I learned something!

Post Reply