home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / files / filecopy / fcopy.pas next >
Encoding:
Pascal/Delphi Source File  |  1988-04-23  |  999 b   |  39 lines

  1. program FCopy;
  2. { FCopy - A demo program for the FileCopy unit
  3.   version 1.1  4/20/88
  4.   by Richard S. Sadowsky
  5.  
  6.   Released to the public domain
  7.  
  8.   USAGE:
  9.  
  10.   FCOPY source dest
  11.   copies file specified by source into file specified by dest.  Souce and dest
  12.   MUST be complete file names (with path if desired).
  13.   In other words, this is unacceptable:
  14.     FCOPY FCOPY.PAS A:
  15.   Instead, you would do:
  16.     FCOPY FCOPY.PAS A:FCOPY.PAS
  17.  
  18.   See FILECOPY.PAS for source to the filecopy unit.
  19. }
  20. uses FileCopy;
  21.  
  22. var
  23.   ErrorCode : Word;
  24.  
  25. begin
  26.   if ParamCount < 2 then begin { make sure user gave us two file names }
  27.     WriteLn('FCOPY SourcePath DestPath'); { show syntax }
  28.     Halt(1)                               { and abort   }
  29.   end;
  30.  
  31.   ErrorCode := File_Copy(ParamStr(1),ParamStr(2),$FFFF); { copy 'em }
  32.   { use as big a copy buffer as possible }
  33.  
  34.   if ErrorCode = 0 then
  35.     WriteLn('Copied!') { WE MADE IT! }
  36.   else
  37.     WriteLn('Error #',ErrorCode); { whoops }
  38. end.
  39.