This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/71431] ifstream::rdbuf directory
- From: "dimaqq at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Jun 2016 11:46:28 +0000
- Subject: [Bug libstdc++/71431] ifstream::rdbuf directory
- Auto-submitted: auto-generated
- References: <bug-71431-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71431
--- Comment #8 from Dima Tisnek <dimaqq at gmail dot com> ---
Looks like I cannot distinguish between a directory and an empty file:
```
buf << expression.rdbuf();
/* check buf.rdstate() */
```
underlying file name was a directory -- rdstate() == 4
underlying file name is empty file -- rdstate() == 4
It's good enough for me (file shouldn't be empty), but may be a gotcha for
someone else.
Personally I find it weird that nothing is set on `expression`, but hey, I
didn't read the standard, did I?