This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: more detailed io state; new_handler and thread safety
On Fri, Apr 05, 2002 at 12:47:11PM -0500, Phil Edwards wrote:
> On Fri, Apr 05, 2002 at 06:11:10PM +0100, Jonathan Wakely wrote:
> > On Fri, Apr 05, 2002 at 07:31:29PM +0200, Matthias Weiss wrote:
> > >
> > AFAIK file permissions aren't covered in standard C or C++, as they're an
> > OS-specific feature.
>
> Correct.
>
> > Personally I'd use stat() in the event of a failure
> > and check the mode, uid and gid, but there are probably better ways.
>
> Since right now we're using the system C library for I/O, you can probably
>
> errno = 0;
> try to get the file;
> if ((it didn't work) && (failbit is set))
> {
> check errno;
> maybe perror();
> }
>
> under the reasonable assumption that the system will do something to errno
> in the case of a problem.
>
> It's still outside the standard, though.
Right, obvious, should have occured to me earlier, sorry for that stupid question!
matthias