Also SysUtils.RenameFile sieht so aus:
Delphi-Quellcode:
function RenameFile(const OldName, NewName: string): Boolean;
begin
{$IFDEF MSWINDOWS}
Result := MoveFile(PChar(OldName), PChar(NewName));
{$ENDIF}
{$IFDEF LINUX}
Result := __rename(PChar(OldName), PChar(NewName)) = 0;
{$ENDIF}
end;
... und für die
API-Funktion MoveFile gilt:
Zitat von
MSDN:
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.
Sollte also ziemlich schnell gehen wenn Quelle und Ziel auf derselben Partition liegen.