[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 117

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 specified new value.

For the Windows enviroment, MoveFileW is called to rename the file using the values specified in OldName and NewName. For UNIX-like enviroments, 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.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.