Index: lib/src/io.dart |
diff --git a/lib/src/io.dart b/lib/src/io.dart |
index 8b7fc17cdf73621c2aa9c22438448f9faa3b030d..952751c451bf9adb716ac7fa76fb90549be54f77 100644 |
--- a/lib/src/io.dart |
+++ b/lib/src/io.dart |
@@ -831,6 +831,15 @@ _doProcess(Function fn, String executable, List<String> args, |
environment: environment); |
} |
+/// Updates [path]'s modification time. |
+void touch(String path) { |
+ var file = new File(path).openSync(mode: FileMode.APPEND); |
+ var originalLength = file.lengthSync(); |
+ file.writeByteSync(0); |
+ file.truncateSync(originalLength); |
+ file.closeSync(); |
+} |
+ |
/// Creates a temporary directory and passes its path to [fn]. |
/// |
/// Once the [Future] returned by [fn] completes, the temporary directory and |