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

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

Issue 12314153: dart:io | Rename File.name to File.path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove stray line break. Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/file.h" 8 #include "bin/file.h"
9 9
10 #include <fcntl.h> // NOLINT 10 #include <fcntl.h> // NOLINT
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 const wchar_t* system_name = StringUtils::Utf8ToWide(name); 158 const wchar_t* system_name = StringUtils::Utf8ToWide(name);
159 int status = _wremove(system_name); 159 int status = _wremove(system_name);
160 free(const_cast<wchar_t*>(system_name)); 160 free(const_cast<wchar_t*>(system_name));
161 if (status == -1) { 161 if (status == -1) {
162 return false; 162 return false;
163 } 163 }
164 return true; 164 return true;
165 } 165 }
166 166
167 167
168 off_t File::LengthFromName(const char* name) { 168 off_t File::LengthFromPath(const char* name) {
169 struct _stat st; 169 struct _stat st;
170 const wchar_t* system_name = StringUtils::Utf8ToWide(name); 170 const wchar_t* system_name = StringUtils::Utf8ToWide(name);
171 int stat_status = _wstat(system_name, &st); 171 int stat_status = _wstat(system_name, &st);
172 free(const_cast<wchar_t*>(system_name)); 172 free(const_cast<wchar_t*>(system_name));
173 if (stat_status == 0) { 173 if (stat_status == 0) {
174 return st.st_size; 174 return st.st_size;
175 } 175 }
176 return -1; 176 return -1;
177 } 177 }
178 178
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 265
266 266
267 File::StdioHandleType File::GetStdioHandleType(int fd) { 267 File::StdioHandleType File::GetStdioHandleType(int fd) {
268 // Treat all stdio handles as pipes. The Windows event handler and 268 // Treat all stdio handles as pipes. The Windows event handler and
269 // socket code will handle the different handle types. 269 // socket code will handle the different handle types.
270 return kPipe; 270 return kPipe;
271 } 271 }
272 272
273 #endif // defined(TARGET_OS_WINDOWS) 273 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698