@@ -197,14 +197,12 @@ abstract class FileSystem {
197
197
/// a `prefix` of `'../foo'` will create a sibling directory to the parent
198
198
/// directory.
199
199
///
200
- /// TODO(brianquinlan): Write to a file in the created temporary directory
201
- /// when that is supported.
202
- ///
203
200
/// ```dart
204
201
/// import 'package:io_file/io_file.dart';
205
202
///
206
203
/// void main() {
207
- /// fileSystem.createTemporaryDirectory(prefix: 'myproject');
204
+ /// final tmp = fileSystem.createTemporaryDirectory(prefix: 'myproject');
205
+ /// fileSystem.writeAsString('$tmp/README.txt', 'Hello World!');
208
206
/// }
209
207
/// ```
210
208
String createTemporaryDirectory ({String ? parent, String ? prefix});
@@ -213,6 +211,9 @@ abstract class FileSystem {
213
211
/// [working directory] (https://en.wikipedia.org/wiki/Working_directory) of
214
212
/// the Dart process.
215
213
///
214
+ /// Absolute or relative paths can be set but the retrieved path will always
215
+ /// be absolute.
216
+ ///
216
217
/// Setting the value of this field will change the working directory for
217
218
/// *all* isolates.
218
219
///
@@ -277,7 +278,7 @@ abstract class FileSystem {
277
278
/// but keeping it the original directory, requires creating a new complete
278
279
/// path with the new name at the end.
279
280
///
280
- ///TODO(brianquinlan): add an example here.
281
+ /// TODO(brianquinlan): add an example here.
281
282
///
282
283
/// On some platforms, a rename operation cannot move a file between
283
284
/// different file systems. If that is the case, instead copy the file to the
@@ -290,10 +291,10 @@ abstract class FileSystem {
290
291
291
292
/// Checks whether two paths refer to the same object in the file system.
292
293
///
293
- /// Throws ` PathNotFoundException` if either path doesn't exist.
294
+ /// Throws [ PathNotFoundException] if either path doesn't exist.
294
295
///
295
296
/// Links are resolved before determining if the paths refer to the same
296
- /// object. Throws ` PathNotFoundException` if either path requires resolving
297
+ /// object. Throws [ PathNotFoundException] if either path requires resolving
297
298
/// a broken link.
298
299
bool same (String path1, String path2);
299
300
@@ -304,7 +305,11 @@ abstract class FileSystem {
304
305
/// 2. the TMP environment variable if set
305
306
/// 3. '/data/local/tmp' on Android, '/tmp' elsewhere
306
307
///
307
- /// TODO(brianquinlan): Add the Windows strategy here.
308
+ /// On Windows, the path is taken from:
309
+ /// 1. the TMP environment variable if set
310
+ /// 2. the TEMP environment variable if set
311
+ /// 3. the USERPROFILE environment variable if set
312
+ /// 4. the Windows directory
308
313
String get temporaryDirectory {
309
314
throw UnsupportedError ('temporaryDirectory' );
310
315
}
@@ -314,7 +319,7 @@ abstract class FileSystem {
314
319
/// If `path` is a broken symlink and `mode` is [WriteMode.failExisting] :
315
320
/// - On Windows, the target of the symlink is created, using `data` as its
316
321
/// contents.
317
- /// - On POSIX, [writeAsBytes] throws ` PathExistsException` .
322
+ /// - On POSIX, [writeAsBytes] throws [ PathExistsException] .
318
323
void writeAsBytes (
319
324
String path,
320
325
Uint8List data, [
@@ -326,7 +331,7 @@ abstract class FileSystem {
326
331
/// If `path` is a broken symlink and `mode` is [WriteMode.failExisting] :
327
332
/// - On Windows, the target of the symlink is created, using `data` as its
328
333
/// contents.
329
- /// - On POSIX, [writeAsBytes] throws ` PathExistsException` .
334
+ /// - On POSIX, [writeAsBytes] throws [ PathExistsException] .
330
335
///
331
336
/// `lineTerminator` is used to replace `'\n'` characters in `content` .
332
337
/// If `lineTerminator` is provided, then it must be one of `'\n'` or
0 commit comments