[Back to DIRS SWAG index]  [Back to Main SWAG index]  [Original]


Program TouchDir;

Uses Dos;

Var S:SearchRec;
     F:Text;
     H,M,S,Hund:Word;
     DOW,Year,Month,Day:Word;
     FTime:LongInt;
     DT:DateTime;
     Dir:String;

Begin
 If ParamCount = 0 Then
 Begin
  Writeln('Usage: TOUCHDIR <dirname>');
  Halt;
 End;
 FindFirst(Dir,Directory,S);
 If DosError = 0 Then
 Begin
  Assign(F,Dir);
  GetTime(H,M,S,Hund);
  GetDate(Year,Month,Day,DOW);
  DT.Hour:=H;
  DT.Min:=M;
  DT.Sec:=S;
  DT.Year:=Year;  
  DT.Month:=Month;
  DT.Day:=Day;
  PackTime(DT,FTime);
  SetFTime(F,FTime);
  Writeln('Touched the ',Dir,' directory.');
 End
End.


[Back to DIRS SWAG index]  [Back to Main SWAG index]  [Original]