What's the syntax to check if a local folder exists?

Ken Ray kray at sonsothunder.com
Tue Jun 7 11:39:25 EDT 2011


> I went for a matching pair of one-liners, which worked very nicely:
> 
> if there is not a folder "this_folder" then create folder "this_folder"
> if there is not a folder "this_folder/that_subfolder" then create folder
> "this_folder/that_subfolder"

Just a reminder - don't forget to check "the result" after you do your
"create folder"; if the OS can't create it for some reason, you'll get
something back in "the result". Here's an example:

create folder "this_folder"
put the result into tResult
if tResult is not empty then
  answer "Could not create folder. Error reported was:" && tResult
  exit to top 
end if


Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/






More information about the use-livecode mailing list