Re: Fopen to create a file in a sub-folder (such as "Mygoal").



user923005 wrote:

On Jan 28, 7:35 pm, Jack Klein <jackkl...@xxxxxxxxxxx> wrote:

<snip>

Why lookup errno?  fopen() is not required to set it.

Too bad. It works on all the platforms that I care about (POSIX,
Windows, OpenVMS, MVS), but it is still tragic that a place where it
would obviously be helpful is left in the cold. I would be curious as
to why such an obviously helpful diagnostic was deemed unnecessary. I
mean, even if I am opening a port in a toaster IC, I would not see any
reason why a hint as to what went wrong would not be in order.

That's exactly the current situation isn't it? In practise errno is set
to something meaningful if the system can do so, but since not all
systems may have that capability the Standard declined from mandating
that errno shall be set by fopen() after a failure.

.