Revision 752 branches/threaded2/src/linad99/df_file.cpp

df_file.cpp (revision 752)
79 79
#include <stdlib.h>
80 80
#include <stdio.h>
81 81
#include <string.h>
82
#include <sstream>
83
#include <thread>
84

  
82 85
  char lastchar(char *);
83 86

  
84 87
  void byte_copy(void * dest,void * source, unsigned num_bytes);
85
  extern char ad_random_part[6];
86 88

  
87 89
/**
88 90
 * Description not yet available.
......
163 165
      }   
164 166
    }
165 167
#endif
166

  
168
    std::thread::id this_thread_id = std::this_thread::get_id();
169
    std::ostringstream oss;
170
    oss << this_thread_id;
171
    char* ad_random_part = oss.str().c_str();
167 172
    if (path != NULL)
168 173
#if defined (__SUN__) ||defined (__GNU__)
169 174
    {
170
      sprintf(&cmpdif_file_name[0],"%s/cmpdiff.%s", path,
171
        ad_random_part);
175
      sprintf(&cmpdif_file_name[0],"%s/cmpdiff%s.tmp", path, ad_random_part);
172 176
    }
173 177
#else
174 178
    if (lastchar(path) != '\\')
175 179
    {
176
      sprintf(&cmpdif_file_name[0],"%s\\cmpdiff.%s", path,
177
        ad_random_part);
180
      sprintf(&cmpdif_file_name[0],"%s\\cmpdiff%s.tmp", path, ad_random_part);
178 181
    }
179 182
    else
180 183
    {
181
      sprintf(&cmpdif_file_name[0],"%scmpdiff.%s", path,
182
        ad_random_part);
184
      sprintf(&cmpdif_file_name[0],"%scmpdiff%s.tmp", path, ad_random_part);
183 185
    }
184 186
#endif
185 187
    else
186 188
    {
187
      sprintf(&cmpdif_file_name[0],"cmpdiff.%s",ad_random_part);
189
      sprintf(&cmpdif_file_name[0],"cmpdiff%s.tmp", ad_random_part);
188 190
    }
189 191
    adstring tmpstring=cmpdif_file_name;
190 192
#if ( defined(USE_ADMPI) || defined(USE_PTHREADS))

Also available in: Unified diff