lua-users home
lua-l archive

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

Jeff Pohlmeyer wrote:
> On Linux the, "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.)

┌─── ───── ─────
│ ⍎'⎕',∊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