Checking for File Existence

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bohrme
Posts: 7
Joined: Wed Dec 23, 2009 4:35 pm

Checking for File Existence

Post by bohrme » Wed Dec 23, 2009 5:18 pm

Is there a way to check for file or directory existence prior to loading/reading/deleting/etc? I'd rather not shell out to an external command just for this. I can't find anything on this topic either in the docs or on the internet.

Thanks.

Larry

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Checking for File Existence

Post by FourthWorld » Wed Dec 23, 2009 8:53 pm

See the "there is" operator, e.g.:

if there is a file tFile then...

or

if there is a folder tFolder then...
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bohrme
Posts: 7
Joined: Wed Dec 23, 2009 4:35 pm

Re: Checking for File Existence

Post by bohrme » Wed Dec 23, 2009 11:13 pm

Argh! Me thinks the simplicity of the language is givin' me scurvy!

Thank you so much. That makes a lot of sense.

Larry

Post Reply