| Index: runtime/bin/file.h
|
| diff --git a/runtime/bin/file.h b/runtime/bin/file.h
|
| index b4e78d8224d44e43919ea452333cd45835ea573e..deffe0e42c4d2ed5cf28fd173d0ae1cc6affee35 100644
|
| --- a/runtime/bin/file.h
|
| +++ b/runtime/bin/file.h
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| @@ -29,6 +29,13 @@ class File {
|
| kWriteTruncate = kWrite | kTruncate
|
| };
|
|
|
| + enum StdioHandleType {
|
| + kTerminal = 0,
|
| + kPipe = 1,
|
| + kFile = 2,
|
| + kOther = 3
|
| + };
|
| +
|
| ~File();
|
|
|
| // Read/Write attempt to transfer num_bytes to/from buffer. It returns
|
| @@ -72,6 +79,10 @@ class File {
|
| // mode contains kTruncate.
|
| static File* Open(const char* name, FileOpenMode mode);
|
|
|
| + // Create a file object for the specified stdio file descriptor
|
| + // (stdin, stout or stderr).
|
| + static File* OpenStdio(int fd);
|
| +
|
| static bool Exists(const char* name);
|
| static bool Create(const char* name);
|
| static bool Delete(const char* name);
|
| @@ -79,6 +90,7 @@ class File {
|
| static char* GetCanonicalPath(const char* name);
|
| static const char* PathSeparator();
|
| static const char* StringEscapedPathSeparator();
|
| + static StdioHandleType GetStdioHandleType(int fd);
|
|
|
| private:
|
| File(const char* name, FileHandle* handle) : name_(name), handle_(handle) { }
|
|
|