lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo wrote:
My understanding was that Lua closed files at program end time.
    
Yes, because C closes all open files when a program ends normally.
However, it's recommended that you close all files yourself to guard against
crashes or bad compilers.
  
While I agree that files should be closed explicitly, it is often the responsability of the operating system to close open files at end time. This means that files are closed even when faced with buggy runtime systems or program crashes. (At least this is true for Unix like systems and Win32)