You may try int _unlink(const char *filename) function, It's fast and portable. :)Clip from MSDN:_unlink, _wunlink Delete a file.int _unlink( const char *filename );int _wunlink( const wchar_t *filename );Routine Required Header Compatibility _unlink <io.h> and <stdio.h> Win 95, Win NT _wunlink <io.h> or <wchar.h> Win NT For additional compatibility information, see Compatibility in the Introduction.LibrariesLIBC.LIB Single thread static library, retail version LIBCMT.LIB Multithread static library, retail version MSVCRT.LIB Import library for MSVCRT.DLL, retail version Return ValueEach of these functions returns 0 if successful. Otherwise, the function returns –1 and sets errno to EACCES, which means the path specifies a read-only file, or to ENOENT, which means the file or path is not found or the path specified a directory.ParameterfilenameName of file to removeResThe _unlink function deletes the file specified by filename. _wunlink is a wide-character version of _unlink; the filename argument to _wunlink is a wide-character string. These functions behave identically otherwise.Generic-Text Routine MappingsTCHAR.H Routine _UNICODE & _MBCS Not Defined _MBCS Defined _UNICODE Defined _tunlink _unlink _unlink _wunlink Example /* UNLINK.C: This program uses _unlink to delete UNLINK.OBJ. */#include <stdio.h>void main( void ) { if( _unlink( "unlink.obj" ) == -1 ) perror( "Could not delete 'UNLINK.OBJ'" ); else printf( "Deleted 'UNLINK.OBJ'\n" ); } OutputDeleted 'UNLINK.OBJ' File Handling RoutinesSee Also _close, remove
Also the delete file action should has no relationship with the partition format, Just need authentication.
可能ntfs需要检查权限,所以慢了些。
其实机器好些就不会有差别。
It's fast and portable. :)Clip from MSDN:_unlink, _wunlink
Delete a file.int _unlink( const char *filename );int _wunlink( const wchar_t *filename );Routine Required Header Compatibility
_unlink <io.h> and <stdio.h> Win 95, Win NT
_wunlink <io.h> or <wchar.h> Win NT
For additional compatibility information, see Compatibility in the Introduction.LibrariesLIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version
Return ValueEach of these functions returns 0 if successful. Otherwise, the function returns –1 and sets errno to EACCES, which means the path specifies a read-only file, or to ENOENT, which means the file or path is not found or the path specified a directory.ParameterfilenameName of file to removeResThe _unlink function deletes the file specified by filename. _wunlink is a wide-character version of _unlink; the filename argument to _wunlink is a wide-character string. These functions behave identically otherwise.Generic-Text Routine MappingsTCHAR.H Routine _UNICODE & _MBCS Not Defined _MBCS Defined _UNICODE Defined
_tunlink _unlink _unlink _wunlink
Example /* UNLINK.C: This program uses _unlink to delete UNLINK.OBJ. */#include <stdio.h>void main( void )
{
if( _unlink( "unlink.obj" ) == -1 )
perror( "Could not delete 'UNLINK.OBJ'" );
else
printf( "Deleted 'UNLINK.OBJ'\n" );
}
OutputDeleted 'UNLINK.OBJ'
File Handling RoutinesSee Also _close, remove