for( int i=0; i<5; i++ )
{
if( !::CopyFile( "d:\\test_copy.txt", "d:\\___HELLO\\test_copy.txt", FALSE) )
cerr<<"Copy test_copy.txt file failed\t"<< i << endl;
else
cout<<"Copy test_copy.txt file ok\t"<< i << endl;
}
when do the first copy, it is ok. but others failed
why?
{
if( !::CopyFile( "d:\\test_copy.txt", "d:\\___HELLO\\test_copy.txt", FALSE) )
cerr<<"Copy test_copy.txt file failed\t"<< i << endl;
else
cout<<"Copy test_copy.txt file ok\t"<< i << endl;
}
when do the first copy, it is ok. but others failed
why?
把其中的FALSE改称TRUE
if (!(dwAttrs & FILE_ATTRIBUTE_READONLY))
{
SetFileAttributes(szNewPath,
dwAttrs | FILE_ATTRIBUTE_READONLY);
}