Files
mercury/tests/general/read_dir_regression.exp2
Paul Bone 675b9ce087 Don't allow directories to be opened as files in C grades.
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.
2016-09-06 14:13:49 +10:00

2 lines
55 B
Plaintext

open failed: can't open input file: . (Is a directory)