Index: runtime/bin/file.h |
diff --git a/runtime/bin/file.h b/runtime/bin/file.h |
index 633c006175fa77f3f081815644e2b4b85f2a5b3e..315ebbe51d707addb2ae7870c11f5e97b90037fc 100644 |
--- a/runtime/bin/file.h |
+++ b/runtime/bin/file.h |
@@ -13,7 +13,6 @@ |
#include "bin/builtin.h" |
#include "bin/dartutils.h" |
- |
namespace dart { |
namespace bin { |
@@ -129,7 +128,10 @@ class File { |
// reading. If mode contains kWrite the file is opened for both |
// reading and writing. If mode contains kWrite and the file does |
// not exist the file is created. The file is truncated to length 0 if |
- // mode contains kTruncate. |
+ // mode contains kTruncate. Assumes we are in an API scope. |
+ static File* ScopedOpen(const char* path, FileOpenMode mode); |
+ |
+ // Like ScopedOpen(), but no API scope is needed. |
static File* Open(const char* path, FileOpenMode mode); |
// Create a file object for the specified stdio file descriptor |
@@ -147,9 +149,9 @@ class File { |
static int64_t LengthFromPath(const char* path); |
static void Stat(const char* path, int64_t* data); |
static time_t LastModified(const char* path); |
- static char* LinkTarget(const char* pathname); |
+ static const char* LinkTarget(const char* pathname); |
static bool IsAbsolutePath(const char* path); |
- static char* GetCanonicalPath(const char* path); |
+ static const char* GetCanonicalPath(const char* path); |
static const char* PathSeparator(); |
static const char* StringEscapedPathSeparator(); |
static Type GetType(const char* path, bool follow_links); |
@@ -191,6 +193,8 @@ class File { |
explicit File(FileHandle* handle) : handle_(handle) { } |
void Close(); |
+ static File* FileOpenW(const wchar_t* system_name, FileOpenMode mode); |
+ |
static const int kClosedFd = -1; |
// FileHandle is an OS specific class which stores data about the file. |