delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/04/05/18:57:09

From: Peter Gerwinski <peter AT gerwinski DOT de>
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

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);

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019