I loaded a list of files (detail information) into tAllFiles. How do I extract the size from the list into a variable? Is there a command that allows me to extract this?
repeat for each line tFile in tAllFiles
...not sure about the command to extract the file size?
Thanks,
Warren
Extracting File Size
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
The file size (in bytes) is in the second item - and if you're on Mac, you may also be interested in the third item for _very_ old files which also contain a resource fork.
If you're looking at converting the creation or modification dates, those are given as 'seconds', so you're looking at
Hope this helped,
Jan Schenkel.
Code: Select all
put the detailed files into tDetailedFiles
repeat for each line tDetailedFile in tDetailedFiles
put item 1 of tDetailedFile into tFileName
put item 2 of tDetailedFile into tFileSize
divide tFileSize by 1024 -- convert to KB
put tFileName & comma & tFileSize & return after tFileNamesAndSizes
end repeat
delete char -1 of tFileNamesAndSizes -- remove trailing return
Code: Select all
put item 4 of tDetailedFile into tCreationDate
convert tCreationDate from seconds to system date and system time
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com