System.IOUtils.TFile.Move

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class procedure Move(SourceFileName, DestFileName: string); static;

C++

static void __fastcall Move(System::UnicodeString SourceFileName, System::UnicodeString DestFileName);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.IOUtils.pas
System.IOUtils.hpp
System.IOUtils TFile

Description

Moves a file from a given path to another path.

Use Move to move a file from a given path to another path. Move raises an exception if DestFileName indicates a file that already exists.


The following table lists the parameters expected by this method:

Name Meaning

SourceFileName

The path of the source file that will be moved.

DestFileName

The destination path to which the file will be moved.

Note: In general, Move has the same behavior on Windows and POSIX. But, for example, trying to move a "/user/file1" to "/usr/somedir/file1" may actually copy it. In POSIX "/usr/somedir", there may be a mount point for another partition, thus a copy is made.

Note: Move raises an exception if the given paths are invalid, do not exist, or cannot be accessed.

See Also

Code Examples