help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'System' (#rtl)

Rename

Rename file on disk

Declaration

Source position: line 0

procedure Rename(

  var f: file;

  const s: String

);

procedure Rename(

  var f: file;

  p: PChar

);

procedure Rename(

  var f: file;

  c: Char

);

procedure Rename(

  var t: Text;

  const s: String

);

procedure Rename(

  var t: Text;

  p: PChar

);

procedure Rename(

  var t: Text;

  c: Char

);

Description

Rename changes the name of the assigned file F to S. F must be assigned, but not opened.

Errors

Depending on the state of the \var{\{\$I\}} switch, a runtime error can be generated if there is an error. In the \var{\{\$I-\}} state, use IOResult to check for errors.

See also

Erase

  

Delete a file from disk

Example

Program Example77;

{ Program to demonstrate the Rename function. }
Var F : Text;

begin
  Assign (F,paramstr(1));
  Rename (F,paramstr(2));
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505