Message7877
Logged In: YES
user_id=21627
Tim was arguing that open("/") fails on some systems,
anyway, since the C library will refuse to open a directory.
So it would be for uniformity's sake that makes it fail on
Posix, as well. I think that fopen() allows to open a
directory is by a similar rationale: if open(2) allows to
open it, fopen(3) should do so as well. That rationale is
already broken: open(2) is needed to read a directory, but
you cannot read a directory if you have a FILE*.
The "used for existence test" argument isn't very
convincing; use access or stat for that (specifically,
os.exists). Of course, changing it might break existing
code, just as changing .readline did.
It is clear that posix.open should forward directly to the
system call, instead of performing checks. It is not so
clear that file() should do the same thing. |
|
Date |
User |
Action |
Args |
2007-08-23 13:57:44 | admin | link | issue487277 messages |
2007-08-23 13:57:44 | admin | create | |
|