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

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

Issue 16140008: dart:io | Make FileStat.stat throw an exception when the file does not exist, or cannot be accessed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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.cc ('k') | runtime/bin/file_linux.cc » ('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 "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_ANDROID) 6 #if defined(TARGET_OS_ANDROID)
7 7
8 #include "bin/file.h" 8 #include "bin/file.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } else { 213 } else {
214 data[kType] = kDoesNotExist; 214 data[kType] = kDoesNotExist;
215 } 215 }
216 data[kCreatedTime] = st.st_ctime; 216 data[kCreatedTime] = st.st_ctime;
217 data[kModifiedTime] = st.st_mtime; 217 data[kModifiedTime] = st.st_mtime;
218 data[kAccessedTime] = st.st_atime; 218 data[kAccessedTime] = st.st_atime;
219 data[kMode] = st.st_mode; 219 data[kMode] = st.st_mode;
220 data[kSize] = st.st_size; 220 data[kSize] = st.st_size;
221 } else { 221 } else {
222 data[kType] = kDoesNotExist; 222 data[kType] = kDoesNotExist;
223 data[kCreatedTime] = 0;
224 data[kModifiedTime] = 0;
225 data[kAccessedTime] = 0;
226 data[kMode] = 0;
227 data[kSize] = 0;
228 } 223 }
229 } 224 }
230 225
231 226
232 time_t File::LastModified(const char* name) { 227 time_t File::LastModified(const char* name) {
233 struct stat st; 228 struct stat st;
234 if (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) { 229 if (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) {
235 return st.st_mtime; 230 return st.st_mtime;
236 } 231 }
237 return -1; 232 return -1;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 return (file_1_info.st_ino == file_2_info.st_ino && 327 return (file_1_info.st_ino == file_2_info.st_ino &&
333 file_1_info.st_dev == file_2_info.st_dev) ? 328 file_1_info.st_dev == file_2_info.st_dev) ?
334 File::kIdentical : 329 File::kIdentical :
335 File::kDifferent; 330 File::kDifferent;
336 } 331 }
337 332
338 } // namespace bin 333 } // namespace bin
339 } // namespace dart 334 } // namespace dart
340 335
341 #endif // defined(TARGET_OS_ANDROID) 336 #endif // defined(TARGET_OS_ANDROID)
OLDNEW
« no previous file with comments | « runtime/bin/file.cc ('k') | runtime/bin/file_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698