walterhiggins/ScriptCraft — pull request #147 by trmfreitas (2014-06-28 12:41:23+00:00)
Title: Classroom autorefresh not working in windows

- Classroom file watcher was not working as expected because lastModifiedTime of a directory is not updated when a file is changed inside it and only directory time was monitored.
- checked creating a file inside directory
- dir time changed
- checked changing a file inside directory
- file time changed
- dir time DID not change
- checked removing a file inside directory
- dir time changed
- checked creating a folder inside directory
- dir time changed
- checked creating a file inside a folder inside directory
- dir time DID not changed
- checked removing a folder inside directory
- dir time changed

- Added functions watchDir/unwatchDir which is responsible for watching all files and subdirectories changes
- Callback is called once for each detected change
- Changed classroom to check for the last "refresh" made to avoid multiple refreshes without changes
- Changed refresh time to 3s because it is much more comfortable
- I don't think this would be an issue because checking for lastModifiedTime should be very fast, perhaps even 3s is too much time
- Tested in Windows