Revision 1176 branches/threaded2merge/src/linad99/df_file.cpp

df_file.cpp (revision 1176)
217 217

  
218 218

  
219 219
/**
220
 * Description not yet available.
221
 * \param
222
 */
223
  DF_FILE::~DF_FILE()
220
Destructor
221
*/
222
DF_FILE::~DF_FILE()
223
{
224
  if (buff)
224 225
  {
225 226
    delete [] buff;
226
    buff=0;
227
    buff_end=0;
227
    buff = 0;
228
  }
229
  buff_end = 0;
228 230

  
229
    int repfs=option_match(ad_comm::argc,ad_comm::argv,"-fsize");
231
  int repfs = option_match(ad_comm::argc, ad_comm::argv, "-fsize");
232
  if (ad_comm::global_logfile && repfs)
233
  {
234
    my_off_t pos;
235
    pos=lseek(file_ptr,0,SEEK_END);
236
    *ad_comm::global_logfile << "size of file " << cmpdif_file_name
237
      << " = " << pos << endl;
238
  }
230 239

  
231
    if (ad_comm::global_logfile && repfs)
232
    {
233
      my_off_t pos;
234
      pos=lseek(file_ptr,0,SEEK_END);
235
      *ad_comm::global_logfile << "size of file " << cmpdif_file_name
236
        << " = " << pos << endl;
237
    }
238

  
239
    if (close(file_ptr))
240
    {
241
      cerr << "Error closing file " << cmpdif_file_name << "\n";
242
    }
243
#   if defined ( __SUN__) ||  defined ( __GNU__)
244
      unlink(cmpdif_file_name);
240
  if (close(file_ptr))
241
  {
242
    cerr << "Error closing file " << cmpdif_file_name << "\n";
243
  }
244
#if defined ( __SUN__) ||  defined ( __GNU__)
245
  unlink(cmpdif_file_name);
245 246
#else
246
      adstring currentdir;
247
      ad_getcd(currentdir);
248
      int xxx=remove(cmpdif_file_name);
249
      if (xxx) {
250
        cerr << "Error trying to delete file " << cmpdif_file_name << endl;
251
        xxx=unlink(cmpdif_file_name);
252
        cout << xxx << endl;
253
      }
247
  adstring currentdir;
248
  ad_getcd(currentdir);
249
  int xxx=remove(cmpdif_file_name);
250
  if (xxx) 
251
  {
252
    cerr << "Error trying to delete file " << cmpdif_file_name << endl;
253
    xxx=unlink(cmpdif_file_name);
254
    cout << xxx << endl;
255
  }
254 256
#endif
255
  }
257
}
256 258

  
257 259

  
258 260
/**

Also available in: Unified diff