home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ipo-101.zip / Samples.zip / RENAME.PAS < prev    next >
Pascal/Delphi Source File  |  1998-03-08  |  409b  |  21 lines

  1. (* This program renames a single file *)
  2. program rename;
  3. var
  4.    f : text;
  5.  
  6.    procedure syntax;
  7.    begin
  8.       writeln('Renames a file');
  9.       writeln('Syntax: ivm rename old new');
  10.       writeln('  renames a file named ''old'' to ''new''');
  11.       exitcode := 1;
  12.       halt
  13.    end;
  14.  
  15. begin
  16.    if paramcount <> 2 then
  17.       syntax;
  18.    assign(f, paramstr(1));
  19.    rename(f, paramstr(2))
  20. end.
  21.