mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-11 11:53:51 +00:00
Some OSs allow you fopen a directory, which could cause confusion. This
doesn't make sense for Mercury file streams so test for and raise an error
when this happens.
library/io.m:
fstat files as we open them to determine if they are directories, if
they are close them and return an error.
tests/general/read_dir_regression.m:
tests/general/read_dir_regression.exp:
tests/general/read_dir_regression.exp2:
tests/general/read_dir_regression.exp3:
tests/general/read_dir_regression.exp4:
Update test case, differentiate between errors opening the file, and
reading from the file.
2 lines
55 B
Plaintext
2 lines
55 B
Plaintext
open failed: can't open input file: . (Is a directory)
|