|
특정 디렉토리에 있는 AA.bak라는 파일을 C:\work 디렉토리에 BB.bak라는 이름으로
Copy하려고 합니다.
그런데...정확히 Copy가 되는지...
제가 테스트한 결과는 정상적으로 동작하는것 같은데...
TFileStream *inHandle;
TFileStream *outHandle;
char *pszBuffer;
inHandle = new TFileStream("C:\\"+"AA.bak",fmOpenRead);
pszBuffer = new char[inHandle->Size];
inHandle->ReadBuffer(pszBuffer,inHandle->Size);
outHandle = new TFileStream("C:\\work\\"+"BB.bak",fmCreate);
outHandle->WriteBuffer(pszBuffer,inHandle->Size);
if(inHandle) delete inHandle;
if(outHandle) delete outHandle;
if(pszBuffer) delete [] pszBuffer;
참고로, AA.bak가 DB File이라고 가정하면...위의 코드에서
Checksum Error가 발생할 경우도 있는듯 하네요. 이러한 문제가 있어서 위의 코드 문제인지
알고 싶어서 이렇게 올렸습니다.
그리고, File Copy 명령으로 CopyFile()이란 함수가 있습니다.
이 함수에 버그가 없는지...
그럼, 수고해 주세요...IT 강국을 향하여
|