lua-users home
lua-l archive

Re: How do I test for the existens of a file

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


On 2008年10月24日, Jeff Pohlmeyer wrote:
On Linux the io.open(name, "r") will fail even on an existing
file if you don't have read permissions, and will succeed if
you do, even when the "name" is actually a directory. (Which
might not be what you expect.)
What's more the open/close method can fail on linux even if the file exists, is a regular file, and you have all the required permissions to it: the file can be too large for you to open! You can get around this surprise by compiling your lua with large file support, which it sadly isn't by default on Debian for instance.
Joonas

AltStyle によって変換されたページ (->オリジナル) /