MoveFile (Windows Embedded Compact 7)

Switch View :
ScriptFree
MoveFile (Windows Embedded Compact 7)
9/30/2011

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

Syntax


BOOL MoveFile(
  LPCTSTR lpExistingFileName, 
  LPCTSTR lpNewFileName
); 
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 can be on a different file system or drive. A new directory must be on the same drive.

Return Value

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

Remarks

This function moves or renames either a file or a directory, including all its children, either in the same directory or across directories. This function fails on directory moves when the destination is on a different volume.

Ee490016.note(en-us,WinEmbedded.70).gifNote:
An unprivileged application can use this function to move or rename a directory that contains a system file. Such a change effectively deletes the system file because it is no longer found in the expected location. Therefore, to fully protect system files, their directory should also have the system attribute.
Requirements

Header

winbase.h

Library

coredll.lib

See Also

Reference

File I/O Functions
CopyFile
DeleteAndRenameFile