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

Side by Side Diff: sdk/lib/io/file.dart

Issue 17033003: dart:io | Add File.rename (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes 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 | « sdk/lib/_internal/lib/io_patch.dart ('k') | sdk/lib/io/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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * FileMode describes the modes in which a file can be opened. 8 * FileMode describes the modes in which a file can be opened.
9 */ 9 */
10 class FileMode { 10 class FileMode {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 /** 74 /**
75 * Synchronously delete the file. Only a file or a link to a file 75 * Synchronously delete the file. Only a file or a link to a file
76 * can be deleted with this method, not a directory or a broken link. 76 * can be deleted with this method, not a directory or a broken link.
77 * 77 *
78 * Throws a [FileException] if the operation fails. 78 * Throws a [FileException] if the operation fails.
79 */ 79 */
80 void deleteSync(); 80 void deleteSync();
81 81
82 /** 82 /**
83 * Renames this file. Returns a `Future<File>` that completes
84 * with a [File] instance for the renamed file.
85 *
86 * If [newPath] identifies an existing file, that file is
87 * replaced. If [newPath] identifies an existing directory, the
88 * operation fails and the future completes with an exception.
89 */
90 Future<File> rename(String newPath);
91
92 /**
93 * Synchronously renames this file. Returns a [File]
94 * instance for the renamed file.
95 *
96 * If [newPath] identifies an existing file, that file is
97 * replaced. If [newPath] identifies an existing directory the
98 * operation fails and an exception is thrown.
99 */
100 File renameSync(String newPath);
101
102 /**
83 * Get a [Directory] object for the directory containing this 103 * Get a [Directory] object for the directory containing this
84 * file. 104 * file.
85 */ 105 */
86 Directory get directory; 106 Directory get directory;
87 107
88 /** 108 /**
89 * Get the length of the file. Returns a [:Future<int>:] that 109 * Get the length of the file. Returns a [:Future<int>:] that
90 * completes with the length in bytes. 110 * completes with the length in bytes.
91 */ 111 */
92 Future<int> length(); 112 Future<int> length();
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 sb.write(" ($osError)"); 536 sb.write(" ($osError)");
517 } 537 }
518 } else if (osError != null) { 538 } else if (osError != null) {
519 sb.write(": osError"); 539 sb.write(": osError");
520 } 540 }
521 return sb.toString(); 541 return sb.toString();
522 } 542 }
523 final String message; 543 final String message;
524 final OSError osError; 544 final OSError osError;
525 } 545 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/lib/io_patch.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698