Get Modification Date of a Single File

Richard Gaskin ambassador at fourthworld.com
Wed Aug 12 20:26:25 CEST 2015


Brahmanathaswami wrote:
 > JB wrote:
 >> I don’t have a mobile but on the older versions
 >> for desktops you use Files command.
 >>
 >> The detailed files form returns a list of files, one file per line.
 >> Each line contains the following attributes, separated by commas:
 >> 	* The file's name, URL-encoded
 >> 	* The file's size in bytes (on Mac OS and OS X systems, the si
 > [snip]
 >
 > I'm very familiar with this, as in my in house production apps that
 > deal globally with work processes here on the LAN, these apps often
 > do folder/file scans that get needed info.
 >
 > But it just seemed like a lot of work to me, to get info on a single
 > file, to have to set the default folder, get the files, parse the
 > file list for just the one you are interested in..

It is, and not just for us scripters but also for the engine as well, 
with a long list of system calls needed for every file in a list, when 
all we want is just one.  Almost always more work than is truly needed, 
and when the directory contains enough files it can be noticeably slow.

But for now it's all we have, so we use it.

And frankly, if you have enough files in a directly to make a noticeable 
difference in LiveCode, you'll find many other aspects of the system are 
slower as well.  This is why collections with large numbers of files, 
like browser caches, separate them by hash values into subfolders.  If 
you have a really large number of files and are currently storing them 
in a single directory, I can share some tips about using hash functions 
to put them into subfolders with roughly equal distribution for faster 
throughput.


 > ideally one could just send the path of a file to a function that
 > would return all this data for that one file.

Yep:
<http://quality.runrev.com/show_bug.cgi?id=13182>

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com



More information about the use-livecode mailing list