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

Side by Side Diff: runtime/bin/file.dart

Issue 10443008: Implement File.lastModified. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Return ms from C Created 8 years, 7 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_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 5
6 /** 6 /**
7 * FileMode describes the modes in which a file can be opened. 7 * FileMode describes the modes in which a file can be opened.
8 */ 8 */
9 class FileMode { 9 class FileMode {
10 static final READ = const FileMode._internal(0); 10 static final READ = const FileMode._internal(0);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 * completes with the length in bytes. 85 * completes with the length in bytes.
86 */ 86 */
87 Future<int> length(); 87 Future<int> length();
88 88
89 /** 89 /**
90 * Synchronously get the length of the file. 90 * Synchronously get the length of the file.
91 */ 91 */
92 int lengthSync(); 92 int lengthSync();
93 93
94 /** 94 /**
95 * Get the last-modified time of the file. Returns a
96 * [:Future<Date>:] that completes with a [Date] object for the
97 * modification date.
98 */
99 Future<Date> lastModified();
100
101 /**
102 * Get the last-modified time of the file. Throws an exception
103 * if the file does not exist.
104 */
105 Date lastModifiedSync();
106
107 /**
95 * Open the file for random access operations. Returns a 108 * Open the file for random access operations. Returns a
96 * [:Future<RandomAccessFile>:] that completes with the opened 109 * [:Future<RandomAccessFile>:] that completes with the opened
97 * random access file. RandomAccessFiles must be closed using the 110 * random access file. RandomAccessFiles must be closed using the
98 * [close] method. 111 * [close] method.
99 * 112 *
100 * Files can be opened in three modes: 113 * Files can be opened in three modes:
101 * 114 *
102 * FileMode.READ: open the file for reading. 115 * FileMode.READ: open the file for reading.
103 * 116 *
104 * FileMode.WRITE: open the file for both reading and writing and 117 * FileMode.WRITE: open the file for both reading and writing and
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 sb.add(" ($osError)"); 381 sb.add(" ($osError)");
369 } 382 }
370 } else if (osError != null) { 383 } else if (osError != null) {
371 sb.add(": osError"); 384 sb.add(": osError");
372 } 385 }
373 return sb.toString(); 386 return sb.toString();
374 } 387 }
375 final String message; 388 final String message;
376 final OSError osError; 389 final OSError osError;
377 } 390 }
OLDNEW
« no previous file with comments | « runtime/bin/file.cc ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698