LiveCode Server and Getting a List of Files in a Folder

Richard Gaskin ambassador at fourthworld.com
Mon Jan 13 15:38:46 EST 2014


Gregory Lypny wrote:

 > Have LiveCode Server running on my Mac. It is configured to look for
 > web pages in the WebServer/Documents folder. But what do I do if I
 > want to use the Files function to get a listing of files in another
 > folder, say, a data folder? When I create a handler in the server
 > using
 >
 > on listMyFiles
 > 	set the default folder to someFolderPath
 > 	put the files
 > end listMyFiles
 >
 > everything gets messed up even if the handler is not called. LiveCode
 > server stops looking for HTML pages in the Documents folder.

Try saving and restoring the original default folder:

on listMyFiles
    put the default folder into tSaveDir
    set the default folder to someFolderPath
    get the files
    set the default folder to tSaveDir
    put it
end listMyFiles


--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  Follow me on Twitter:  http://twitter.com/FourthWorldSys





More information about the use-livecode mailing list