> > Question: Is the use of O_TEMPORARY to open() portable? (my
> win32 docs
> > say it will make the file automatically deleted when the last
> > descriptor is closed, which I didn't know before. That
> would make the
> > patch much simpler, but might require #ifdefs?)
>
> I think it would be more elegant if you wrote a replacement
> implementation of
> tmpfile() for pgport and did not change pg_dump at all.
> And/or write a bug to Microsoft about a buggy C library. :)
It's not buggy. It's well documented behaviour,and per my linux manpage
for the file it's also OK per spec:
The standard does not specify the directory that tmpfile() will use. Glibc will try the path prefix P_tmpdir
defined in <stdio.h>, and if that fails the directory /tmp.
It's certainly *stupid*, but not buggy ;-)
//Magnus