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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
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 ac1a268077f39856bc314f7d6f4e4f0d4cb7e9a6..450a9020abb0920d6203897039b5173815366477 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -80,6 +80,26 @@ abstract class File implements FileSystemEntity {
void deleteSync();
/**
+ * Renames this file. Returns a `Future<File>` that completes
+ * with a [File] instance for the renamed 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> rename(String newPath);
+
+ /**
+ * Synchronously renames this file. Returns a [File]
+ * instance for the renamed 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 renameSync(String newPath);
+
+ /**
* Get a [Directory] object for the directory containing this
* file.
*/
« 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