Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: lib/src/io.dart

Issue 1307853004: Improve the heuristics for "pub get" is needed. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/executable.dart ('k') | test/must_pub_get_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « lib/src/executable.dart ('k') | test/must_pub_get_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698