Description
The rename procedure changes the name of a file.
Parameters
(* This program renames a single file *)
program rename;
var
f : text;
procedure syntax;
begin
writeln('Renames a file');
writeln('Syntax: ivm rename old new');
writeln(' renames a file named ''old'' to ''new''');
exitcode := 1;
halt
end;
begin
if paramcount <> 2 then
syntax;
assign(f, paramstr(1)); //Specify which file you want to rename
rename(f, paramstr(2)) //Change the name of the file
end.
Portability
Operating Systems: All
Standard Pascal: No