home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!ftpbox!news.acns.nwu.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!newsserver.jvnc.net!yale.edu!qt.cs.utexas.edu!news.Brown.EDU!noc.near.net!news.cs.brandeis.edu!binah.cc.brandeis.edu!GILMOUR
- From: gilmour@binah.cc.brandeis.edu (Jeffrey R. Gilmour)
- Subject: Turbo C FOPEN error
- Message-ID: <1993Jan27.053643.21953@news.cs.brandeis.edu>
- Sender: news@news.cs.brandeis.edu (USENET News System)
- Reply-To: gilmour@binah.cc.brandeis.edu
- Organization: Brandeis University
- Date: Wed, 27 Jan 1993 05:36:43 GMT
- Lines: 46
-
- I can't figure out what's wrong. This program works fine as long as there's
- less than 16 files (it doesn't actually matter what drive). I haven't come
- across anything explaining it in the manual. The error happens at runtime
- during the 'stream = fopen(name...' line. Anybody?
-
- /*
- ** FOPENERR.C
- */
-
- #include "stdio.h"
- #include "io.h"
- #include "dos.h"
-
- void main(void)
- {
- int done;
- char name[15];
- struct find_t test;
- struct ftime ft;
- FILE *stream;
-
- done = _dos_findfirst("a:*.*", _A_NORMAL, &test);
- while (!done) {
- strcpy(name, "a:");
- strcat(name, test.name);
- if ((stream = fopen(name, "r")) == NULL) {
- printf("Error in opening filename.\n");
- exit (1);
- }
-
- getftime(fileno(stream), &ft);
- printf("%-16s%7lu\t%2u/%02u/%u\n", name,
- test.size, ft.ft_month,
- ft.ft_day, ft.ft_year+1980);
- done = _dos_findnext(&test);
- }
- fclose(stream);
- }
-
- ___________________________________
- |__/~~~~~\__/~~~~\__/~~~~\__/~~~~\_|/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
- |____/~\____/~\_____/~\_____/~\____|\ /
- |____/~\____/~~~\___/~~~\___/~~~\__|/ T h i s S p a c e f o r R e n t \
- |____/~\____/~\_____/~\_____/~\____|\ /
- |__/~~~\____/~~~~\__/~\_____/~\____|/ GILMOUR@BINAH.CC.BRANDEIS.EDU \
- |__________________________________|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
-