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

Unified Diff: pkg/path/README.md

Issue 19231002: Port dart:io Path tests to package:path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comment to relative(path, from: from) Created 7 years, 5 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 | pkg/path/lib/path.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/path/README.md
diff --git a/pkg/path/README.md b/pkg/path/README.md
index dacacaa8396c66c6027eba754b9611c1d9f8cb51..4108ce0c103bbc438cd778d66f14583f58426974 100644
--- a/pkg/path/README.md
+++ b/pkg/path/README.md
@@ -73,6 +73,16 @@ Trailing separators are ignored.
builder.dirname('path/to/'); // -> 'path'
+If an absolute path contains no directories, only a root, then the root
+is returned.
+
+ path.dirname('/'); // -> '/' (posix)
+ path.dirname('c:\'); // -> 'c:\' (windows)
+
+If a relative path has no directories, then '.' is returned.
+ path.dirname('foo'); // -> '.'
+ path.dirname(''); // -> '.'
+
### String extension(String path)
Gets the file extension of [path]: the portion of [basename] from the last
@@ -200,6 +210,9 @@ If the [from] argument is passed, [path] is made relative to that instead.
path.relative('/root/other.dart',
from: '/root/path'); // -> '../other.dart'
+If [path] and/or [from] are relative paths, they are assumed to be relative
+to the current directory.
+
Since there is no relative path from one drive letter to another on Windows,
this will return an absolute path in that case.
« no previous file with comments | « no previous file | pkg/path/lib/path.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698