[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How do I test for the existens of a file
- From: "Robert Raschke" <rtrlists@...>
- Date: Fri, 24 Oct 2008 14:27:34 +0100
On Fri, Oct 24, 2008 at 2:20 PM, TheLonelyStar <nabble2@lonely-star.org> wrote:
> I want to test if a specific file exist, and do something if yes. Like
>
> if <file exist> then
> <do something>
> else
> <do something else>
> end
>
> How do I do that?
I use
function file_exists(file_name)
local file = io.open(file_name)
if file then
file:close()
end
return file ~= nil
end
Robby