[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'LazFileUtils' (#lazutils)

RenameFileUTF8

Renames a file to the specified value.

Declaration

Source position: lazfileutils.pas line 121

function RenameFileUTF8(

  const OldName: string;

  const NewName: string

):Boolean;

Arguments

OldName

  

Existing name for the file.

NewName

  

New name for the file.

Function result

True if the file is successfully renamed to the new value.

Description

RenameFileUTF8 is a Boolean function used to rename a file to the value specified in NewName.

For the Windows environment, MoveFileW is called to rename the file using the values specified in OldName and NewName. For UNIX-like environments, RenameFile in SysUtils is called to rename the file to the specified new value. InvalidateFileStateCache is also called.

The return value is True if the file is renamed successfully.


Version 3.2 Generated 2024-02-25 Home