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

Unified Diff: runtime/bin/directory_win.cc

Issue 9622001: Add the ability to get the current directory (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix windows Created 8 years, 9 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
Index: runtime/bin/directory_win.cc
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index 95e68a7fc187a370974731a994df8e8d56975ebb..1faea98d59d3b30fa97245e3f4c70d1e4da55bae 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -324,6 +324,15 @@ Directory::ExistsResult Directory::Exists(const char* dir_name) {
}
+char* Directory::Current() {
+ char* result;
+ int length = GetCurrentDirectory(0, NULL);
+ result = reinterpret_cast<char*>(malloc(length + 1));
+ GetCurrentDirectory(length + 1, result);
+ return result;
+}
+
+
bool Directory::Create(const char* dir_name) {
return (CreateDirectory(dir_name, NULL) != 0);
}

Powered by Google App Engine
This is Rietveld 408576698