Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about the function fclose and fcloseall

Author: Robert Hyatt

Date: 08:23:29 05/31/04

Go up one level in this thread


On May 31, 2004 at 08:14:22, Uri Blass wrote:

>I think to close all open files and the simplest way seems to me to use
>fcloseall that is supposed to close all open files.
>
>when I look at crafty code I  see code like
>
>if (book_file) fclose(book_file);
>if (books_file) fclose(books_file);
>if (book_lrn_file) fclose(book_lrn_file);
>if (position_file) fclose(position_file);
>if (position_lrn_file) fclose(position_lrn_file);
>if (history_file) fclose(history_file);
>if (log_file) fclose(log_file);
>
>My question is if it is not more simple to use one fcloseall() function that
>should close all the open files by definition.
>
>Uri


fcloseall is not in _every_ C library.  That's the only reason I didn't use it.
Early I did, but as we added support for different machines and O/S
combinations, a problem came up (I don't remember which system however)...




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.