On 2 Sep 2005, at 00:21, Mark Smith wrote:

put the path to the directory you want into a variable:

put URL ("ftp:" & pathToYourRemoteDirectory) into fList
--this puts a list of the files into variable fList
-- each line in fList will look something like:
--09-01-05  03:55PM               298694 myfile.doc
-- where (in this case) word -1 of each line is the name of the file or folder


Just a couple of small additions. Using "word 9" is probably safer than using "word -1" to get the name of the file. The reason is that additional data can appear after the file name, for example, if the file is a link to another file. Using word 9 assumes the ftp server is returning directory listings in standard Unix format (which is the case with most servers, even on Windows).

drwxr-x---   3 dave  staff   102 Mar 29  2003 liburltestaxx
-rwxr--r--   1 dave  staff   981 Apr  8  2002 urlconfig.mc

(If you know in advance the server you are dealing with, you should probably confirm the directory listing format before you make your script.)

To distinguish directories from files, check that char 1 in any line of the listing = "d".


Cheers
Dave
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to