Xref: news2.mv.net comp.os.msdos.djgpp:2268 From: christian DOT felique AT student DOT kuleuven DOT ac DOT be (christian felique) Newsgroups: comp.os.msdos.djgpp Subject: How to close all files in C ? Date: 29 Mar 1996 11:46:36 GMT Organization: Katholieke Universiteit Leuven Lines: 37 Message-ID: <4jgiis$fjd@chaos.kulnet.kuleuven.ac.be> NNTP-Posting-Host: cc399.cc.kuleuven.ac.be To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp I am using a shareware C routine to play a sound sample throught the PC speaker. SoundPlay("SAMPLE.VOC",delay,twiddle); I think that the programmer of the routine has forgotten to take care of closing the sample file after it is played, because the routine will not work anymore after a few calls (about 10 calls) (It displays an Out of Memory message) I think that the Out of Memory error has got nothing to do with the size of a sound sample file, because: * You can call the routine for about 10 times using a small sample. * " " " " " """"""""""""""10 """"""""""""large """"""" According to me, the reason for the out of memory error is the fact that there are too many file buffers open . NOW THIS IS MY QUESTION: How can I close all files that are opened ? I can't use fclose(...) because fclose needs a file pointer as an argument. If you know how to solve this problem in Quick C or inline assembly. Then send me your answer to: CHRISTIAN DOT FELIQUE AT STUDENT DOT KULEUVEN DOT AC DOT BE