[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    Re: How do I test for the existens of a file
From:       M Joonas Pihlaja <jpihlaja () cc ! helsinki ! fi>
Date:       2008-10-28 23:07:17
Message-ID: Pine.OSF.4.61.0810290054150.165982 () sirppi ! helsinki ! fi
[Download RAW message or body]


On Fri, 24 Oct 2008, 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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic