🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4965

Close all opened files in C ?

#4965
From: christian felique
Date: Fri, 29 Mar 1996 11:44
37 lines
1431 bytes
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.FELIQUE@STUDENT.KULEUVEN.AC.BE


 
Technical Details
Message-ID: <4jgifa$fjd@chaos.kulnet.kuleuven.ac.be>
Path: arc1-ca.pugleaf.net!chaos.kulnet.kuleuven.ac.be!usenet

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!chaos.kulnet.kuleuven.ac.be!usenet
From: christian.felique@student.kuleuven.ac.be (christian felique)
Newsgroups: comp.std.c
Subject: Close all opened files in C ?
Date: 29 Mar 1996 11:44:42 GMT
Organization: Katholieke Universiteit Leuven
Message-ID: <4jgifa$fjd@chaos.kulnet.kuleuven.ac.be>
NNTP-Posting-Host: cc399.cc.kuleuven.ac.be
X-Newsreader: WinVN 0.92.6+