replaced unlink() & _unlink() with more standard remove() (ticket #334)

This commit is contained in:
Vadim Pisarevsky 2010-07-17 11:51:17 +00:00
parent 1d93ca00de
commit f894d1de31
4 changed files with 8 additions and 12 deletions

View File

@ -332,7 +332,7 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
if( !decoder->readHeader() )
{
if( filename )
unlink(filename);
remove(filename);
return 0;
}
@ -374,7 +374,7 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
bool code = decoder->readData( *data );
if( filename )
unlink(filename);
remove(filename);
if( !code )
{
@ -441,7 +441,7 @@ bool imencode( const string& ext, const Mat& image,
fseek( f, 0, SEEK_SET );
buf.resize(fread( &buf[0], 1, buf.size(), f ));
fclose(f);
unlink(filename);
remove(filename);
}
return code;
}

View File

@ -507,11 +507,11 @@ void CV_FlannSavedIndexTest::createModel(const cv::Mat &data)
}
char filename[50];
tmpnam( filename );
if(filename[0] == '\\') filename[0] = '_';
if(filename[0] == '\\') filename[0] = '_';
index->save( filename );
createIndex( data, SavedIndexParams(filename));
unlink( filename );
remove( filename );
}
CV_LSHTest lsh_test;

View File

@ -425,11 +425,7 @@ void CV_IOTest::run( int )
}
fs.release();
#ifdef _MSC_VER
_unlink(filename);
#else
unlink(filename);
#endif
remove(filename);
}
}

View File

@ -105,8 +105,8 @@ int CV_SLMLTest::validate_test_results( int testCaseIdx )
f1.close();
f2.close();
// delete temporary files
unlink( fname1 );
unlink( fname2 );
remove( fname1 );
remove( fname2 );
// 2. compare responses
CV_Assert( test_resps1.size() == test_resps2.size() );