1

The following code was copied from here. It seems not working on version 11.0.1.0 ...

    Begin["Kale`"];
    fileName = "~/foo.txt";
    lastModified = {};
    updatedQ := With[{modificationDate = FileDate[fileName,"Modification"]}, 
    If[lastModified == modificationDate, False, lastModified = modificationDate; True]];
    task = CreateScheduledTask[If[updatedQ, Print["Changed"], ## &[]], {2, ∞}];
    End[];
    StartScheduledTask[Kale`task];
Leo1215
  • 167
  • 6

0 Answers0