[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: David Given <dg@...>
- Date: Fri, 24 Oct 2008 23:42:36 +0100
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.)
Don't forget that on Windows it might also fail if the file is in use by
another application; a lot of Windows apps appear to default to
exclusive file access, and the Windows kernel enforces it.
(e.g. if I open a ZIP file in 7-Zip and then forget to close the window
before running the script to regenerate the file, it fails horribly. Grr.)
--
ââââ ïïïïïïïïïïïïïï âââââ http://www.cowlark.com âââââ
â
â â'â',âNââSâ'âââ(3=T)âMâ2=Tââ+/(Vâ"âM),(Vâ"M),(V,âV)â"(V,Vâ1â1)â"âM)'
â --- Conway's Game Of Life, in one line of APL
Attachment:
signature.asc
Description: OpenPGP digital signature