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

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

Issue 23468027: Add FileSystemEntity.absolutePath and .isAbsolute properties. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change name to absolute, return type to File, Directory, and Link. Created 7 years, 3 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_system_entity.dart ('k') | tests/standalone/io/file_absolute_path_test.dart » ('j') | 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 3df3fc9f1d5692534f1556aa1b69dae5303b7a8c..83cd22379a1ad6f4556aec92b22ae5c741deb1a1 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -85,6 +85,15 @@ abstract class Link implements FileSystemEntity {
Link renameSync(String newPath);
/**
+ * Returns a [Link] instance whose path is the absolute path to [this].
+ *
+ * The absolute path is computed by prefixing
+ * a relative path with the current working directory, and returning
+ * an absolute path unchanged.
+ */
+ Link get absolute;
+
+ /**
* Gets the target of the link. Returns a future that completes with
* the path to the target.
*
@@ -127,6 +136,8 @@ class _Link extends FileSystemEntity implements Link {
bool existsSync() => FileSystemEntity.isLinkSync(path);
+ Link get absolute => new Link(_absolutePath);
+
Future<FileStat> stat() => FileStat.stat(path);
FileStat statSync() => FileStat.statSync(path);
« no previous file with comments | « sdk/lib/io/file_system_entity.dart ('k') | tests/standalone/io/file_absolute_path_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698