home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPTOOL1.ZIP / COPYTIME.INC < prev    next >
Encoding:
Text File  |  1987-03-28  |  877 b   |  36 lines

  1.  
  2. const copytime_tag: string[90]
  3.    = #0'@(#)CURRENT_FILE LAST_UPDATE Copy timestamps library 1.0'#0;
  4. #log Copy timestamps library 1.0
  5.  
  6. (*
  7.  * COPYTIME.INC - This utility library will copy the timestamp
  8.  *                of one file to another file.
  9.  *
  10.  * The statement
  11.  *   {$I \shs\tools\dosio.inc}
  12.  * is required in the main program
  13.  *
  14.  * Author: S.H.Smith, 4/4/86
  15.  *
  16.  *)
  17.  
  18. procedure copytime(fromname: anystring; toname: anystring);
  19. var
  20.    fd:     integer;
  21.    time:   integer;
  22.    date:   integer;
  23.  
  24. begin
  25.    fd := dos_open(fromname, open_read);
  26.    dos_file_times(fd,time_get,time,date);
  27.    if dos_close(fd) = dos_error then
  28.       writeln(con,'copytime: close error');
  29.  
  30.    fd := dos_open(toname, open_update);
  31.    dos_file_times(fd,time_set,time,date);
  32.    if dos_close(fd) = dos_error then
  33.       writeln(con,'copytime: to close error');
  34. end;
  35.  
  36.