From: Peter Gerwinski Message-Id: <199804052155.XAA31054@esmeralda.gerwinski.de> Subject: Re: I/O problems To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii) Date: Sun, 5 Apr 1998 23:55:38 +0200 (MEST) Cc: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk Hello again! I wrote: > > 1) `mktemp()' looks for "ccaaaaaa.*" rather than for just > "ccaaaaaa", > > 2) `gpc1.exe' creates a dummy "ccaaaaaa", so `mktemp()' will > find it, or > > 3) `gpc1.exe' does something else (e.g. does not use `mktemp()') > to ensure that all base names are unique. Method (2) works, and it's not *too* clumsy /-: 8< ---- from `gpc.c' (essentially `gcc.c' from gcc-2.8.0) -------------- /* Choose directory for temp files. */ temp_filename = choose_temp_base (); temp_filename_length = strlen (temp_filename); #ifdef GPC #ifdef __MSDOS__ /* Ensure that `temp_filename' is really unique by * creating a dummy file of that name. */ { FILE *kludge = fopen (temp_filename, "wc"); fclose (kludge); record_temp_file (temp_filename, 1, 0); } #endif #endif /* Make a table of what switches there are (switches, n_switches). Make a table of specified input files (infiles, n_infiles). Decode switches that are handled locally. */ process_command (argc, argv);