lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Sat, 25 Oct 2008 16:06:05 -0700 (PDT)
TheLonelyStar <> 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
use lfs module (search at LuaForge), or write this:
local fl ="");
if fl then
  <file exists; do not forget to close it first. or read data if that's
  what you need>
  print("no file. so sad.");