home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 1.ddi / SOURCE / U4TEMP_C.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-19  |  469 b   |  26 lines

  1.  
  2. #include "d4all.h"
  3. #include "u4error.h"
  4. #include <time.h>
  5.  
  6. int  u4temp_create( char *file_name )
  7. {
  8.    int     i, h ;
  9.    time_t  t ;
  10.  
  11.    time( &t ) ;
  12.    t %= 1000000L ;
  13.  
  14.    for ( i=0; i < 100; i++, t++ )
  15.    {
  16.       c4ltoa( (long) t, file_name+2, -6 ) ;
  17.       file_name[8] = '\000' ;
  18.  
  19.       h = u4open( file_name, 9 ) ;
  20.       if ( h >= 0 )  return h ;
  21.    }
  22.  
  23.    u4error( E_CREATE, "Temporary Working File Create", (char *) 0 ) ;
  24.    return -1 ;
  25. }
  26.