[問題] MoveFile的問題
我想將一個選定的檔案move到指定的路徑下
我是使用MoveFile()這個function
int result;
char cNewPathName[256];
char cOldPathName[256];
DWORD nBufferLength = 200; // size of directory buffer
TCHAR CurrentPath[200];
memset( CurrentPath, NULL, sizeof(CurrentPath) );
memset( cNewPathName, NULL, sizeof(cNewPathName) );
memset( cOldPathName, NULL, sizeof(cOldPathName) );
printf("Enter target path >");
gets(cNewPathName);
GetCurrentDirectory(nBufferLength, CurrentPath);
sprintf(cOldPathName, "%s\\%s.%s\0", CurrentPath, FilesName, FilesExt);
result = MoveFile(cOldPathName, cNewPathName);
不過一直失敗 result都收到0的回傳值
麻煩版友幫我診斷一下 Orz
謝謝
--
★
╔╮ ╭═╦╮╭═╦╗╮ ╮╔══╮╭═╦╮╮ ╔╮╔══╮╭══╮
╠╣ ╠═╬╣╭╬╩╯╰╦╦╯╠═╦╮║ ╠╣║║╠╣╠╣ ╰═╦╮
╠╣ ╭║ ╠╣║╰╔╗ ╠╣ ║ ╠╣║ ╠╣║╰╠╣║╰╔╗║ ╠╣
╰╩═╯╰ ╰╝╚═╩╯ ╰╝ ╚═╩╯╰═╩╯╰ ╰╝╚═╩╯╰═╩╯
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.211.0.80
推
11/11 10:10, , 1F
11/11 10:10, 1F
→
11/11 10:11, , 2F
11/11 10:11, 2F
→
11/11 10:33, , 3F
11/11 10:33, 3F
推
11/11 12:58, , 4F
11/11 12:58, 4F
推
11/11 13:01, , 5F
11/11 13:01, 5F
→
11/11 13:08, , 6F
11/11 13:08, 6F