Skip to content

Commit 9ea41b1

Browse files
authored
Work around an incorrect error code on iOS/Android when opening a directory (#260)
1 parent aaa25f9 commit 9ea41b1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkgs/io_file/test/read_as_bytes_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ void main() {
6666
'errorCode',
6767
io.Platform.isWindows
6868
? win32.ERROR_ACCESS_DENIED
69-
: (io.Platform.isIOS
70-
// It seems like an iOS but that ENOENT can be
71-
// returned when attempting to read a directory.
72-
? anyOf(errors.enoent, errors.eisdir)
73-
: errors.eisdir),
69+
// iOS and Android can fail with ENOENT when calling
70+
// `open` on a directory. This may be due to
71+
// file system sandboxing.
72+
// TODO(bquinlan): Clarify this.
73+
: anyOf(errors.enoent, errors.eisdir),
7474
)
7575
.having((e) => e.path1, 'path1', path),
7676
),

0 commit comments

Comments
 (0)