home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / date / touch / touch.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1988-08-26  |  593 b   |  32 lines

  1. uses dos;
  2.  
  3. var f : file;
  4.     fname : string[12];
  5.     thedate : datetime;
  6.     junk : word;
  7.     p : longint;
  8.  
  9. begin
  10.   if paramcount<>0 then fname:=paramstr(1)
  11.   else
  12.     begin
  13.       write('What is the name of the file you want to change? ');
  14.       readln(fname);
  15.     end;
  16.   assign(f,fname);
  17.   {$I-}  reset(f);  {$I+}
  18.   if ioresult<>0 then
  19.   begin
  20.     writeln('Error in opening ',fname);
  21.     halt(1);
  22.   end;
  23.   with thedate do
  24.   begin
  25.     getdate(year,month,day,junk);
  26.     gettime(hour,min,sec,junk);
  27.   end;
  28.   packtime(thedate,p);
  29.   setftime(f,p);
  30.   close(f);
  31. end.
  32.