Partager via


MoveFile (Windows CE 5.0)

Send Feedback

This function renames an existing file or a directory, including all its children. A RAPI version of this function exists, called CeMoveFile.

BOOLMoveFile(LPCTSTRlpExistingFileName, LPCTSTRlpNewFileName);

Parameters

  • lpExistingFileName
    [in] Pointer to a null-terminated string that names an existing file or directory.
  • lpNewFileName
    [in] Pointer to a null-terminated string that specifies the new name of a 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.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

The MoveFile function will move or rename either a file or a directory, including all 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.

Note   An untrusted application can use MoveFile to move or rename a directory that contains a system file. Such a change effectively deletes the system file because it will no longer be found in an expected location. Therefore, to fully protect a system file, the directory the file is in should also be given the system attribute.

To store the maximum number of files on PC Card storage devices, limit file names to eight uppercase characters and file extensions to three uppercase characters. Also, do not allow non-OEM characters in file names. File names that do not conform to these limits require more than one physical directory entry on a PC Card.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Winbase.h.
Link Library: Coredll.lib.

See Also

CopyFile | DeleteAndRenameFile

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.