Skip to content

Commit 56b9d74

Browse files
authored
Fixes to dartdoc in FileSystem (#270)
1 parent 77464e7 commit 56b9d74

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

pkgs/io_file/lib/src/file_system.dart

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,12 @@ abstract class FileSystem {
197197
/// a `prefix` of `'../foo'` will create a sibling directory to the parent
198198
/// directory.
199199
///
200-
/// TODO(brianquinlan): Write to a file in the created temporary directory
201-
/// when that is supported.
202-
///
203200
/// ```dart
204201
/// import 'package:io_file/io_file.dart';
205202
///
206203
/// void main() {
207-
/// fileSystem.createTemporaryDirectory(prefix: 'myproject');
204+
/// final tmp = fileSystem.createTemporaryDirectory(prefix: 'myproject');
205+
/// fileSystem.writeAsString('$tmp/README.txt', 'Hello World!');
208206
/// }
209207
/// ```
210208
String createTemporaryDirectory({String? parent, String? prefix});
@@ -213,6 +211,9 @@ abstract class FileSystem {
213211
/// [working directory](https://en.wikipedia.org/wiki/Working_directory) of
214212
/// the Dart process.
215213
///
214+
/// Absolute or relative paths can be set but the retrieved path will always
215+
/// be absolute.
216+
///
216217
/// Setting the value of this field will change the working directory for
217218
/// *all* isolates.
218219
///
@@ -277,7 +278,7 @@ abstract class FileSystem {
277278
/// but keeping it the original directory, requires creating a new complete
278279
/// path with the new name at the end.
279280
///
280-
///TODO(brianquinlan): add an example here.
281+
/// TODO(brianquinlan): add an example here.
281282
///
282283
/// On some platforms, a rename operation cannot move a file between
283284
/// different file systems. If that is the case, instead copy the file to the
@@ -290,10 +291,10 @@ abstract class FileSystem {
290291

291292
/// Checks whether two paths refer to the same object in the file system.
292293
///
293-
/// Throws `PathNotFoundException` if either path doesn't exist.
294+
/// Throws [PathNotFoundException] if either path doesn't exist.
294295
///
295296
/// 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
297298
/// a broken link.
298299
bool same(String path1, String path2);
299300

@@ -304,7 +305,11 @@ abstract class FileSystem {
304305
/// 2. the TMP environment variable if set
305306
/// 3. '/data/local/tmp' on Android, '/tmp' elsewhere
306307
///
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
308313
String get temporaryDirectory {
309314
throw UnsupportedError('temporaryDirectory');
310315
}
@@ -314,7 +319,7 @@ abstract class FileSystem {
314319
/// If `path` is a broken symlink and `mode` is [WriteMode.failExisting]:
315320
/// - On Windows, the target of the symlink is created, using `data` as its
316321
/// contents.
317-
/// - On POSIX, [writeAsBytes] throws `PathExistsException`.
322+
/// - On POSIX, [writeAsBytes] throws [PathExistsException].
318323
void writeAsBytes(
319324
String path,
320325
Uint8List data, [
@@ -326,7 +331,7 @@ abstract class FileSystem {
326331
/// If `path` is a broken symlink and `mode` is [WriteMode.failExisting]:
327332
/// - On Windows, the target of the symlink is created, using `data` as its
328333
/// contents.
329-
/// - On POSIX, [writeAsBytes] throws `PathExistsException`.
334+
/// - On POSIX, [writeAsBytes] throws [PathExistsException].
330335
///
331336
/// `lineTerminator` is used to replace `'\n'` characters in `content`.
332337
/// If `lineTerminator` is provided, then it must be one of `'\n'` or

0 commit comments

Comments
 (0)