Skip to content

Commit 9735b74

Browse files
committed
Add support for stat and modified time on sys
1 parent e4128af commit 9735b74

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/compiler/sys.ts

+9
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ module ts {
1818
readDirectory(path: string, extension?: string): string[];
1919
getMemoryUsage? (): number;
2020
exit(exitCode?: number): void;
21+
getModififedTime? (fileName: string): Date;
22+
stat? (fileName: string, callback?: (err: any, stats: any) => any): void;
2123
}
2224

2325
export interface FileWatcher {
@@ -303,6 +305,13 @@ module ts {
303305
},
304306
exit(exitCode?: number): void {
305307
process.exit(exitCode);
308+
},
309+
getModififedTime(fileName: string): Date {
310+
var stats = _fs.statSync(fileName);
311+
return stats.mtime;
312+
},
313+
stat(fileName: string, callback?: (err: any, stats: any) => any) {
314+
_fs.stat(fileName, callback);
306315
}
307316
};
308317
}

0 commit comments

Comments
 (0)