diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-10-12 20:57:26 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-10-12 20:57:26 +0100 |
commit | 0590d09ae24d89eece8a377293acc8a21d89bc7c (patch) | |
tree | 2b1a036c2d374d20a9a5bd28a6bcf9f9880b6eea | |
parent | 31742dfb2cb06089fe0e6e87ec1ed21a8d4d5dfb (diff) | |
download | fpGUI-0590d09ae24d89eece8a377293acc8a21d89bc7c.tar.xz |
Creates a fpGUI wrapper for RTL's RenameFile() function.
-rw-r--r-- | src/corelib/fpg_utils.pas | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/fpg_utils.pas b/src/corelib/fpg_utils.pas index 2f20e1dc..dcc0cf71 100644 --- a/src/corelib/fpg_utils.pas +++ b/src/corelib/fpg_utils.pas @@ -68,6 +68,7 @@ function fpgChangeFileExt(const FileName, Extension: TfpgString): TfpgString; function fpgGetAppConfigDir(const Global: Boolean): TfpgString; function fpgGetAppConfigFile(const Global: Boolean; const SubDir: Boolean): TfpgString; function fpgGetExecutableName: TfpgString; +function fpgRenameFile(const OldName, NewName: TfpgString): Boolean; implementation @@ -188,6 +189,11 @@ begin Result := fpgChangeFileExt(fpgExtractFileName(Paramstr(0)), ''); end; +function fpgRenameFile(const OldName, NewName: TfpgString): Boolean; +begin + Result := RenameFile(fpgToOSEncoding(OldName), fpgToOSEncoding(NewName)); +end; + function fpgAppendPathDelim(const Path: TfpgString): TfpgString; begin if (Path <> '') and (Path[length(Path)] <> PathDelim) then |