외규장각 도서 환수 모금 캠페인

MoveFile API

Posted 2007. 8. 9. 14:48, Filed under: Study/Computer Science

MoveFile

Moves an existing file or a directory, including its children.
To specify how to move the file, use the MoveFileEx or MoveFileWithProgress function.
To perform this operation as a transacted operation, use the MoveFileTransacted function.

BOOL WINAPI MoveFile(
  LPCTSTR lpExistingFileName,
  LPCTSTR lpNewFileName
);

Parameters
lpExistingFileName
[in] The current name of the file or directory on the local computer.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "//?/" to the path. For more information, see Naming a File.
Windows Me/98/95:  This string must not exceed MAX_PATH characters.

lpNewFileName
[in] The new name for the file or directory. The new name must not already exist. A new file may be on a different file system or drive. A new directory must be on the same drive.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "file://?/" to the path. For more information, see Naming a File.
Windows Me/98/95:  This string must not exceed MAX_PATH characters.

Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
The MoveFile function will move (rename) either a file or a directory (including its children) either in the same directory or across directories. The one caveat is that the MoveFile function will fail on directory moves when the destination is on a different volume.

If a file is moved across volumes, MoveFile does not move the security descriptor with the file. The file will be assigned the default security descriptor in the destination directory.

The MoveFile function coordinates its operation with the link tracking service, so link sources can be tracked as they are moved.

-----------
including its children

이것도 모르고 재귀 호출하면서 경로 탐색해서 CopyFile 로 하나하나 폴더 만들고
하위 파일 복사하고  빈 폴더 지워주고 ㅠ-ㅠ 

Response : ,


Recent Posts

Recent Comments

Recent Trackbacks

Total hit (Today , Yesterday )

Admin Write Post