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

Side by Side Diff: runtime/bin/file_win.cc

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | runtime/bin/process_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/file.h" 5 #include "bin/file.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <io.h> 8 #include <io.h>
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if (((mode & kWrite) != 0) && ((mode & kTruncate) == 0)) { 116 if (((mode & kWrite) != 0) && ((mode & kTruncate) == 0)) {
117 int position = lseek(fd, 0, SEEK_END); 117 int position = lseek(fd, 0, SEEK_END);
118 if (position < 0) { 118 if (position < 0) {
119 return NULL; 119 return NULL;
120 } 120 }
121 } 121 }
122 return new File(name, new FileHandle(fd)); 122 return new File(name, new FileHandle(fd));
123 } 123 }
124 124
125 125
126 File* File::OpenStdio(int fd) {
127 UNREACHABLE();
128 return NULL;
129 }
130
131
126 bool File::Exists(const char* name) { 132 bool File::Exists(const char* name) {
127 struct stat st; 133 struct stat st;
128 if (stat(name, &st) == 0) { 134 if (stat(name, &st) == 0) {
129 return ((st.st_mode & S_IFMT) == S_IFREG); 135 return ((st.st_mode & S_IFMT) == S_IFREG);
130 } else { 136 } else {
131 return false; 137 return false;
132 } 138 }
133 } 139 }
134 140
135 141
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 176
171 177
172 const char* File::PathSeparator() { 178 const char* File::PathSeparator() {
173 return "\\"; 179 return "\\";
174 } 180 }
175 181
176 182
177 const char* File::StringEscapedPathSeparator() { 183 const char* File::StringEscapedPathSeparator() {
178 return "\\\\"; 184 return "\\\\";
179 } 185 }
186
187
188 File::StdioHandleType File::GetStdioHandleType(int fd) {
189 // Treat all stdio handles as pipes. The Windows event handler and
190 // socket code will handle the different handle types.
191 return kPipe;
192 }
OLDNEW
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | runtime/bin/process_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698