[Issue 7537] `File.tmpfile` requires administrator rights on Windows

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 28 01:53:20 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=7537


Vladimir Panteleev <thecybershadow at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
           Platform|All                         |x86_64
         Resolution|FIXED                       |


--- Comment #10 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-01-28 11:52:42 EET ---
(In reply to comment #3)
> What?? How is this not a bug?

I may have been wrong here. The problem is not present on Win32, but on Win64
the MS runtime does what the DMC runtime used to do - attempt to create the
file in the drive root. And it's not a bug, it's working according to the
documentation:

> The tmpfile function creates a temporary file and returns a pointer to that 
> stream. The temporary file is created in the root directory. To create a 
> temporary file in a directory other than the root, use tmpnam or tempnam in 
> conjunction with fopen.

Conclusion: this function is horrible and needs to be replaced with something
better.

Some relevant discussion here:
https://github.com/D-Programming-Language/phobos/pull/691

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list