As the title says... Chat on...

User avatar
By gerardwr
#3710 Nothing in the API doc, and never seen any workaround yet.

Tried if open has a returning value that you could check: It doesn't :cry:
Code: Select all>"init.txt","r")
lua: stdin:1: cannot open file
lua: stdin:1: cannot open file

Only method I see right now is to write a nasty procedure that executes the "" command in a string, catch the return value, and check if this value.

Is a lua challenge, some background here: ... ndling.htm

If you go on this slippery path, report back if you have any luck, I'm interested.
User avatar
By ThomasW
zeroday"init.lua","r") or"init.lua")
if init.lua not exist, a error shows.
in next release this api will return a nil if the file not exists.

Meanwhile, this should work also:
Code: Select allif file.list()[filename] then ....

(found here: ... mented-lua)

Edit: hey, even better - this returns either nil or the filesize :)