Article View: comp.os.msdos.programmer
Article #1524C Question
From: libh
Date: Wed, 16 Sep 1992 02:57
Date: Wed, 16 Sep 1992 02:57
25 lines
2303 bytes
2303 bytes
I am currently writing a file sort in TC++ 3.0 that will sort a file with an unknown number of entries (in the range of 600 to 80,000). I am reading the entries until memory if full, sorting them, writing them to a temp file, reading in the next batch of entries from the file, sorting them in memory, and then merging them with the temp file into temp2. Then I use SYSTEM() to rename temp2 to temp and continue on reading, sorting, and merging until I get an end of file from the input file. The problem I face is that the SYSTEM() seems to be resetting the file pointer to my input file (which I leave open until finished) back to the beginning of the file. Could someone please let me know if I am just missing something painfully obvious and stupid or does the SYSTEM() function close all open files when it executes (None of these supposedly large bookstore chains carry a TC++ Bible). If SYSTEM() closes all open files then using FSEEK() and FREAD() seem to be the next choice for input rather than FGETS(). Thanks in advance for any and all help. And as a side note, this isn't for a school project. ******************************************************************************** * | What do I see? * * | I see time as it affects all things . . . * * John White | Human flesh withers and dies before my eyes. . * * | Flowers bloom only to fade . . . * * Libh@Jetson.uh.edu | Trees drop green leaves, never to regain them * * | In my sight. . .it is always winter. . .always night * * | -- Raistlin -- * ********************************************************************************
Technical Details
Message-ID:
<1992Sep16.025709.1473@menudo.uh.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!menudo.uh.edu!Jane.UH.EDU!LIBHShow Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!menudo.uh.edu!Jane.UH.EDU!LIBH From: libh@Jane.UH.EDU Subject: C Question Message-ID: <1992Sep16.025709.1473@menudo.uh.edu> Sender: usenet@menudo.uh.edu (USENET News System) Nntp-Posting-Host: jane.uh.edu Reply-To: libh@Jane.UH.EDU Organization: University of Houston Date: Wed, 16 Sep 1992 02:57:09 GMT Lines: 26