tasks/simple_watch.js
function watchFile(filepath) {
			if (!watchedFiles[filepath]) {
				// add a new file to watched files
				var statStructure = null;
				try {
					statStructure = fs.statSync(filepath);
				} catch (e) { // StatSync can throw an error if the file has dissapeared in between
					return;
				}

				watchedFiles[filepath] = statStructure;
				mtimes[filepath] = +watchedFiles[filepath].mtime;
			}
		}
function watchFile(filepath) {
			if (!watchedFiles[filepath]) {
				// add a new file to watched files
				var statStructure = null;
				try {
					statStructure = fs.statSync(filepath);
				} catch (e) { // StatSync can throw an error if the file has dissapeared in between
					return;
				}

				watchedFiles[filepath] = statStructure;
				mtimes[filepath] = +watchedFiles[filepath].mtime;
			}
		}
function watchFile ( filepath ) { if ( ! watchedFiles [ filepath ] ) { // add a new file to watched files var statStructure = null ; try { statStructure = fs . statSync ( filepath ) ; } catch ( e ) { // StatSync can throw an error if the file has dissapeared in between return ; } watchedFiles [ filepath ] = statStructure ; mtimes [ filepath ] = + watchedFiles [ filepath ] . mtime ; } }
Watch a file.
Watch a file .