> > Ok. Should be easy enough once the code is fine - can you > comment on > > the patch as sent, if the code itself looks right provided > i wrap it > > up in a function in port/? > > Not sure if the error handling is adequate --- are there any > cases besides EEXIST that should loop?
Well, per docs I can get: EACCES (will certainly fail again since we're still working the same directory) EEXIST (covered) EINVAL = invalid oflag or pmode, which should never happen EMFILE = too many open files (that would be the one, but I doubd it'd help that much) ENOENT = path ont found (would happen agai non retry) > A look at > http://msdn.microsoft.com/library/default.asp?url=/library/en- > us/vclib/html/_crt__tempnam.2c_._wtempnam.2c_.tmpnam.2c_._wtmpnam.asp > > suggests that tempnam() is also pretty fragile, esp. if > you're passing NULLs. Apparently it won't work at all if TMP > isn't set? I'm not *too* concerned about that, since TMP is normally set by the OS itself. There's one set in the "system environment" (to c:\windows\temp or whatrever) and then it's overridden by one set by the OS when it loads a user profile. Also to the point, what would you fall back to? //Magnus ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org