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

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

Issue 13862003: dart:io | Add documentation changes to Link, File and Directory delete methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 7 years, 8 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/io/file.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/link.dart
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index d5ed8c49bcda58e0eafc4a1bf25f3035e739447f..347ae1f5147ba5a0ce02822200b6b405db11e2ab 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -34,13 +34,17 @@ abstract class Link extends FileSystemEntity {
/**
* Creates a symbolic link. Returns a [:Future<Link>:] that completes with
- * the link when it has been created. If the link exists, the function
+ * the link when it has been created. If the link exists,
* the future will complete with an error.
*
* On the Windows platform, this will only work with directories, and the
* target directory must exist. The link will be created as a Junction.
* Only absolute links will be created, and relative paths to the target
* will be converted to absolute paths.
+ *
+ * On other platforms, the posix symlink() call is used to make a symbolic
+ * link containing the string [target]. If [target] is a relative path,
+ * it will be interpreted relative to the directory containing the link.
*/
Future<Link> create(String target);
@@ -52,6 +56,10 @@ abstract class Link extends FileSystemEntity {
* target directory must exist. The link will be created as a Junction.
* Only absolute links will be created, and relative paths to the target
* will be converted to absolute paths.
+ *
+ * On other platforms, the posix symlink() call is used to make a symbolic
+ * link containing the string [target]. If [target] is a relative path,
+ * it will be interpreted relative to the directory containing the link.
*/
void createSync(String target);
@@ -70,14 +78,18 @@ abstract class Link extends FileSystemEntity {
/**
* Deletes the link. Returns a [:Future<Link>:] that completes with
- * the link when it has been deleted. This does not delete, or otherwise
- * affect, the target of the link.
+ * the link when it has been deleted. This does not delete, or otherwise
+ * affect, the target of the link. It also works on broken links, but if
+ * the link does not exist or is not actually a link, it completes the
+ * future with a LinkIOException.
*/
Future<Link> delete();
/**
* Synchronously deletes the link. This does not delete, or otherwise
- * affect, the target of the link.
+ * affect, the target of the link. It also works on broken links, but if
+ * the link does not exist or is not actually a link, it throws a
+ * LinkIOException.
*/
void deleteSync();
@@ -204,7 +216,7 @@ class _Link extends FileSystemEntity implements Link {
static throwIfError(Object result, String msg) {
if (result is OSError) {
- throw new FileIOException(msg, result);
+ throw new LinkIOException(msg, result);
}
}
@@ -226,9 +238,7 @@ class _Link extends FileSystemEntity implements Link {
case _OSERROR_RESPONSE:
var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
response[_OSERROR_RESPONSE_ERROR_CODE]);
- return new FileIOException(message, err);
- case _FILE_CLOSED_RESPONSE:
- return new FileIOException("File closed");
+ return new LinkIOException(message, err);
default:
return new Exception("Unknown error");
}
« no previous file with comments | « sdk/lib/io/file.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698