Skip to content

Commit 6a1d88b

Browse files
committed
Refuse writes and resizes on a directory descriptor itself
1 parent 6cd91d2 commit 6a1d88b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/natives/io.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ class DirectoryFile extends OpenFile {
208208
override read(): number {
209209
throw new PendingThrow("java/io/IOException", "Is a directory");
210210
}
211+
212+
override write(): void {
213+
throw new PendingThrow("java/io/IOException", "Is a directory");
214+
}
215+
216+
override setLength(): void {
217+
throw new PendingThrow("java/io/IOException", "Is a directory");
218+
}
211219
}
212220

213221
// Reads and writes a character device as a stream.

0 commit comments

Comments
 (0)