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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/io_service.h ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file.dart
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index 152fb6edf8c678326ec2065ae51df7a7703f3462..7369640f527fac04342ff03386f0152a9da9e353 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -107,6 +107,26 @@ abstract class File implements FileSystemEntity {
File renameSync(String newPath);
/**
+ * Copy this file. Returns a `Future<File>` that completes
+ * with a [File] instance for the copied file.
+ *
+ * If [newPath] identifies an existing file, that file is
+ * replaced. If [newPath] identifies an existing directory, the
+ * operation fails and the future completes with an exception.
+ */
+ Future<File> copy(String newPath);
+
+ /**
+ * Synchronously copy this file. Returns a [File]
+ * instance for the copied file.
+ *
+ * If [newPath] identifies an existing file, that file is
+ * replaced. If [newPath] identifies an existing directory the
+ * operation fails and an exception is thrown.
+ */
+ File copySync(String newPath);
+
+ /**
* Get the length of the file. Returns a [:Future<int>:] that
* completes with the length in bytes.
*/
« 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