Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!bbn!oberon!cit-vax!oxy!bagpiper From: bagpiper@oxy.UUCP Newsgroups: comp.lang.c Subject: FILE * <-> System File Handles Message-ID: <2.bagpiper@oxy.uucp> Date: Thu, 1-Oct-87 19:00:00 EDT Article-I.D.: oxy.2.bagpiper Posted: Thu Oct 1 19:00:00 1987 Date-Received: Sat, 3-Oct-87 08:49:34 EDT Organization: Occidental College Lines: 49 In article <2853@husc6.UUCP>,ddl@husc6.UUCP (Dan Lanciani) >In article <173@westmark.UUCP>, dave@westmark.UUCP (Dave Levenson) writes: >| In article <1576@dicome.UUCP>, stryker@dicome.UUCP (don Stryker) writes: >| >| > I've run up against a disturbing feature of the Microsoft C compiler >| > for the PC. Microsoft limits an applicaton to 20 open files, 5 of >| > which are taken up by the standard file handles. I can open my files >| > using DOS system calls to bypass the compiler, ... >| >| This limit is imposed by MS-DOS itself, not by the C compiler. > > Unfortunately, the limit is also imposed by the C library >which maintains its own table of open file descriptors. This table >contains information about the binary/text mode of the file and >whether it is open (don't know why they really need the second). >(This is for MSC 4.0.) > > > Dan Lanciani > ddl@harvard.* ahhhh...I had a problem the other day the I think may have something to do with this. The following piece of code will clarify: #include main() { FILE *otherptr ; fprintf(stdprn,"This goes to the system printer!!") ; otherptr = strprn ; fprintf(otherptr,"And so does this...(on the same line even)\n") ; fclose(otherptr) ; fprintf(stdprn,"But this doesn't....???????\n") ; } BTW, this was using IBM C 1.0 (can anybody tell me roughly what MSC version this is??). fclose seems to have a FILE * linked in some manner with the corresponding system file handle. When you have two pointers sharing a handle (as seems to happen in this case), fclose seems to close out both the system handle as well as the FILE *. Not the question is: Does this make sense? I have been able to convince my self both ways. Anybody got a good argument!! Michael Hunter UUCP : ....{seismo, rutgers, ames}!cit-vax!oxy!bagpiper Box 241 ARPA : oxy!bagpiper@csvax.caltech.edu Occidental College BITNET: oxy!bagpiper@hamlet.bitnet Los Angeles, CA 90041 CSNET : oxy!bagpiper%csvax.caltech.edu@relay.cs.net