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

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

Issue 105133004: Add File.copy(Sync) to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix permissions. Created 7 years 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/io_service.h ('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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 * Synchronously renames this file. Returns a [File] 100 * Synchronously renames this file. Returns a [File]
101 * instance for the renamed file. 101 * instance for the renamed file.
102 * 102 *
103 * If [newPath] identifies an existing file, that file is 103 * If [newPath] identifies an existing file, that file is
104 * replaced. If [newPath] identifies an existing directory the 104 * replaced. If [newPath] identifies an existing directory the
105 * operation fails and an exception is thrown. 105 * operation fails and an exception is thrown.
106 */ 106 */
107 File renameSync(String newPath); 107 File renameSync(String newPath);
108 108
109 /** 109 /**
110 * Copy this file. Returns a `Future<File>` that completes
111 * with a [File] instance for the copied file.
112 *
113 * If [newPath] identifies an existing file, that file is
114 * replaced. If [newPath] identifies an existing directory, the
115 * operation fails and the future completes with an exception.
116 */
117 Future<File> copy(String newPath);
118
119 /**
120 * Synchronously copy this file. Returns a [File]
121 * instance for the copied file.
122 *
123 * If [newPath] identifies an existing file, that file is
124 * replaced. If [newPath] identifies an existing directory the
125 * operation fails and an exception is thrown.
126 */
127 File copySync(String newPath);
128
129 /**
110 * Get the length of the file. Returns a [:Future<int>:] that 130 * Get the length of the file. Returns a [:Future<int>:] that
111 * completes with the length in bytes. 131 * completes with the length in bytes.
112 */ 132 */
113 Future<int> length(); 133 Future<int> length();
114 134
115 /** 135 /**
116 * Synchronously get the length of the file. 136 * Synchronously get the length of the file.
117 * 137 *
118 * Throws a [FileSystemException] if the operation fails. 138 * Throws a [FileSystemException] if the operation fails.
119 */ 139 */
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 } 581 }
562 } else if (osError != null) { 582 } else if (osError != null) {
563 sb.write(": osError"); 583 sb.write(": osError");
564 if (path != null) { 584 if (path != null) {
565 sb.write(", path = $path"); 585 sb.write(", path = $path");
566 } 586 }
567 } 587 }
568 return sb.toString(); 588 return sb.toString();
569 } 589 }
570 } 590 }
OLDNEW
« no previous file with comments | « runtime/bin/io_service.h ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698