This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/71431] ifstream::rdbuf directory


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?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]