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

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

Issue 8437056: Implemented File create API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 interface File factory _File { 5 interface File factory _File {
6 /** 6 /**
7 * Create a File object. 7 * Create a File object.
8 */ 8 */
9 File(String name); 9 File(String name);
10 10
11 /** 11 /**
12 * Check if the file exists. The [existsHandler] is called with the 12 * Check if the file exists. The [existsHandler] is called with the
13 * result when the operation completes. 13 * result when the operation completes.
14 */ 14 */
15 void exists(); 15 void exists();
16 16
17 /** 17 /**
18 * Synchronously check if the file exists. 18 * Synchronously check if the file exists.
19 */ 19 */
20 bool existsSync(); 20 bool existsSync();
21 21
22 /** 22 /**
23 * Create the file. The [createHandler] is called when the file has 23 * Create the file. The [createHandler] is called when the file has
24 * been created. The errorHandler is called if the file cannot be 24 * been created. The errorHandler is called if the file cannot be
25 * created. 25 * created. Existing files are left untouched by create. Calling
26 * create on an existing file might fail if there are restrictive
27 * permissions on the file.
26 */ 28 */
27 void create(); 29 void create();
28 30
29 /** 31 /**
30 * Synchronously create the file. 32 * Synchronously create the file. Existing files are left untouched
33 * by create. Calling create on an existing file might fail if there
34 * are restrictive permissions on the file.
31 */ 35 */
32 void createSync(); 36 void createSync();
33 37
34 /** 38 /**
35 * Open the file for random access operations. When the file is 39 * Open the file for random access operations. When the file is
36 * opened the openHandler is called. Opened files must be closed 40 * opened the openHandler is called. Opened files must be closed
37 * using the [close] method. By default writable is false. 41 * using the [close] method. By default writable is false.
38 */ 42 */
39 void open([bool writable]); 43 void open([bool writable]);
40 44
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 198
195 interface FileOutputStream extends OutputStream { 199 interface FileOutputStream extends OutputStream {
196 } 200 }
197 201
198 202
199 class FileIOException implements Exception { 203 class FileIOException implements Exception {
200 const FileIOException([String this.message = ""]); 204 const FileIOException([String this.message = ""]);
201 String toString() => "FileIOException: $message"; 205 String toString() => "FileIOException: $message";
202 final String message; 206 final String message;
203 } 207 }
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