Mail Archives: djgpp-workers/2003/02/25/20:41:01
Hello.
Eli Zaretskii wrote:
>
> > Date: Tue, 25 Feb 2003 12:40:50 +0000
> > From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
> >
> > FWIW Linux allows writes to the file, after fchmod'ing to be read-only.
> > The test program at the end of this mail works fine on Linux. The file
> > is read-only afterwards.
>
> Then there's no problem, I think. Thanks for looking into this.
You're welcome. It's nice to see DOS works like Linux sometimes (or
vice-versa!).
> > I thought about returning ENOSYS instead of ENOENT. I think you suggested
> > this before. But this would be misleading, I think. I take ENOSYS to mean
> > that the system call is not implemented at all, whereas we've partially
> > implemented it. So I think ENOENT is right.
>
> ENOSYS means the feature is not supported, so I think it's okay. I
> won't mind to use ENOENT, but please consider what will a user think
> when presented with "No such file or directory" in response to a
> function that didn't accept any file name.
I agree ENOSYS makes more sense from a user's perspective. I'll change the
code.
I also wonder how many people will actually check fchmod's return code...
> > But how do we detect that standard handles are piped?
>
> Call isatty on the handle; if it returns zero, the handle is
> redirected.
But can we assume file descriptors 0, 1, etc. are actually standard handles?
What happens if the program closes them and then opens some other file? I
don't think we can reliably tell whether it's a standard handle. So we can't
return the pipe-specific error.
Thanks, bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -