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

Unified Diff: runtime/bin/file.h

Issue 9360040: Handle stdio redirection in standalone VM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revert test change Created 8 years, 10 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 | « runtime/bin/eventhandler_linux.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) { }
« no previous file with comments | « runtime/bin/eventhandler_linux.cc ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698