close(file); always necessary??

leledumbo leledumbo_cool at
Tue Jun 15 13:06:21 CEST 2010

Why rely on implementation? One good coding practice is to close what you've
opened. AFAIK in most Pascal implementation, even if the OS will close the
file upon program exit, the buffer that contains something you write will
not be flushed. So you will lose everything you've written.

Rugxulo wrote:
> Hey,
>    In non-standard Pascal mode, does it matter if I explicitly close
> the file or not? E.g., "close(file);", is that done automatically or
> is it implementation defined? (I'm 99% sure DOS always closes files
> upon exit.) I'm just wondering if that's a fair assumption for Linux,
> etc. (though I kinda doubt it).

View this message in context:
Sent from the Gpc mailing list archive at

More information about the Gpc mailing list