Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Sure it's OS-specific, but if C can do it, why can't C++? C would set errno to ENOENT as distinct from EACCESS or other errors. Commented Oct 27, 2023 at 17:32
  • My answer was in relation to the standard C++ library. If you're calling OS-specific libraries that's not really C++ providing the feature. You're just calling OS-specific libraries from C++. Commented Dec 16, 2023 at 4:43
  • I was trying to say that there's room in a language for OS-agnostic ways of doing this (such as fopen from the C standard library). C++ may not currently expose such a thing, but there's no reason it couldn't or shouldn't. I was mostly responding to a vague sense of "this is the way it has to be" that I got from your answer's phrasing. Commented Dec 19, 2023 at 21:44