Add slightly nicer failure message to io.rs when it can't open a file.
This commit is contained in:
parent
c4e0085291
commit
460d89156f
@ -108,7 +108,10 @@ fn stdin() -> reader {
|
||||
|
||||
fn file_reader(str path) -> reader {
|
||||
auto f = os.libc.fopen(_str.buf(path), _str.buf("r"));
|
||||
check (f as uint != 0u);
|
||||
if (f as uint == 0u) {
|
||||
log "error opening " + path;
|
||||
fail;
|
||||
}
|
||||
ret FILE_reader(f, true);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user