OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 * Information about the environment in which the current program is running. | 8 * Information about the environment in which the current program is running. |
9 * | 9 * |
10 * Platform provides information such as the operating system, | 10 * Platform provides information such as the operating system, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 * returned on Windows is therefore case-insensitive and will convert | 124 * returned on Windows is therefore case-insensitive and will convert |
125 * all keys to upper case. On other platforms the returned map is | 125 * all keys to upper case. On other platforms the returned map is |
126 * a standard case-sensitive map. | 126 * a standard case-sensitive map. |
127 */ | 127 */ |
128 static Map<String, String> get environment => _Platform.environment; | 128 static Map<String, String> get environment => _Platform.environment; |
129 | 129 |
130 /** | 130 /** |
131 * Returns the path of the executable used to run the script in this | 131 * Returns the path of the executable used to run the script in this |
132 * isolate. | 132 * isolate. |
133 * | 133 * |
134 * If supported by the platform the returned path will be absolute. | 134 * The path returned is the literal path used to run the script. This |
| 135 * path might be relative or just be a name from which the executable |
| 136 * was found by searching the `PATH`. |
135 * | 137 * |
136 * If the execution environment does not support [executable] an empty | 138 * To get the absolute path to the resolved executable use |
137 * string is returned. | 139 * [resolvedExecutable]. |
138 */ | 140 */ |
139 static String get executable => _Platform.executable; | 141 static String get executable => _Platform.executable; |
140 | 142 |
141 /** | 143 /** |
| 144 * Returns the path of the executable used to run the script in this |
| 145 * isolate after it has been resolved by the OS. |
| 146 * |
| 147 * This is the absolute path, with all symlinks resolved, to the |
| 148 * executable used to run the script. |
| 149 */ |
| 150 static String get resolvedExecutable => _Platform.resolvedExecutable; |
| 151 |
| 152 /** |
142 * Returns the absolute URI of the script being run in this | 153 * Returns the absolute URI of the script being run in this |
143 * isolate. | 154 * isolate. |
144 * | 155 * |
145 * If the script argument on the command line is relative, | 156 * If the script argument on the command line is relative, |
146 * it is resolved to an absolute URI before fetching the script, and | 157 * it is resolved to an absolute URI before fetching the script, and |
147 * this absolute URI is returned. | 158 * this absolute URI is returned. |
148 * | 159 * |
149 * URI resolution only does string manipulation on the script path, and this | 160 * URI resolution only does string manipulation on the script path, and this |
150 * may be different from the file system's path resolution behavior. For | 161 * may be different from the file system's path resolution behavior. For |
151 * example, a symbolic link immediately followed by '..' will not be | 162 * example, a symbolic link immediately followed by '..' will not be |
(...skipping 24 matching lines...) Expand all Loading... |
176 /** | 187 /** |
177 * Returns the version of the current Dart runtime. | 188 * Returns the version of the current Dart runtime. |
178 * | 189 * |
179 * The returned `String` is formatted as the | 190 * The returned `String` is formatted as the |
180 * [semver](http://semver.org) version string of the current dart | 191 * [semver](http://semver.org) version string of the current dart |
181 * runtime, possibly followed by whitespace and other version and | 192 * runtime, possibly followed by whitespace and other version and |
182 * build details. | 193 * build details. |
183 */ | 194 */ |
184 static String get version => _version; | 195 static String get version => _version; |
185 } | 196 } |
OLD | NEW |