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

Unified Diff: sdk/lib/io/file_system_entity.dart

Issue 18042002: dart:io | Add rename() and renameSync() to FileSystem Entity (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file_system_entity.dart
diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart
index 1723508b141ade31d7e002ab15539378dcb93949..a63b12ceb804bf2200bb48049a26e8160bfc34dd 100644
--- a/sdk/lib/io/file_system_entity.dart
+++ b/sdk/lib/io/file_system_entity.dart
@@ -271,6 +271,27 @@ abstract class FileSystemEntity {
bool existsSync();
/**
+ * Renames this file system entity. Returns a `Future<FileSystemEntity>`
+ * that completes with a [FileSystemEntity] instance for the renamed
+ * file system entity.
+ *
+ * If [newPath] identifies an existing entity of the same type, that entity
+ * is replaced. If [newPath] identifies an existing entity of a different
+ * type, the operation fails and the future completes with an exception.
+ */
+ Future<FileSystemEntity> rename(String newPath);
+
+ /**
+ * Synchronously renames this file system entity. Returns a [FileSystemEntity]
+ * instance for the renamed entity.
+ *
+ * If [newPath] identifies an existing entity of the same type, that entity
+ * is replaced. If [newPath] identifies an existing entity of a different
+ * type, the operation fails and an exception is thrown.
+ */
+ FileSystemEntity renameSync(String newPath);
+
+ /**
* Calls the operating system's stat() function on the [path] of this
* [FileSystemEntity]. Identical to [:FileStat.stat(this.path):].
*
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698