OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * The modes in which a File can be opened. | 8 * The modes in which a File can be opened. |
9 */ | 9 */ |
10 class FileMode { | 10 class FileMode { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 * a section from _A Tour of the Dart Libraries_ | 168 * a section from _A Tour of the Dart Libraries_ |
169 * covers files and directories. | 169 * covers files and directories. |
170 * | 170 * |
171 * * [Write Command-Line Apps](https://www.dartlang.org/docs/tutorials/cmdline/)
, | 171 * * [Write Command-Line Apps](https://www.dartlang.org/docs/tutorials/cmdline/)
, |
172 * a tutorial about writing command-line apps, includes information | 172 * a tutorial about writing command-line apps, includes information |
173 * about files and directories. | 173 * about files and directories. |
174 | 174 |
175 */ | 175 */ |
176 abstract class File extends FileSystemEntity { | 176 abstract class File extends FileSystemEntity { |
177 /** | 177 /** |
178 * Create a File object. | 178 * Creates a [File] object. |
| 179 * |
| 180 * If [path] is a relative path, it will be interpreted relative to the |
| 181 * current working directory (see [Directory.current]), when used. |
| 182 * |
| 183 * If [path] is an absolute path, it will be immune to changes to the |
| 184 * current working directory. |
179 */ | 185 */ |
180 factory File(String path) => new _File(path); | 186 factory File(String path) => new _File(path); |
181 | 187 |
182 /** | 188 /** |
183 * Create a File object from a URI. | 189 * Create a File object from a URI. |
184 * | 190 * |
185 * If [uri] cannot reference a file this throws [UnsupportedError]. | 191 * If [uri] cannot reference a file this throws [UnsupportedError]. |
186 */ | 192 */ |
187 factory File.fromUri(Uri uri) => new File(uri.toFilePath()); | 193 factory File.fromUri(Uri uri) => new File(uri.toFilePath()); |
188 | 194 |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 sb.write(": $osError"); | 740 sb.write(": $osError"); |
735 if (path != null) { | 741 if (path != null) { |
736 sb.write(", path = '$path'"); | 742 sb.write(", path = '$path'"); |
737 } | 743 } |
738 } else if (path != null) { | 744 } else if (path != null) { |
739 sb.write(": $path"); | 745 sb.write(": $path"); |
740 } | 746 } |
741 return sb.toString(); | 747 return sb.toString(); |
742 } | 748 } |
743 } | 749 } |
OLD | NEW |