www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7537] New: `File.tmpfile` requires administrator rights on Windows

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537

           Summary: `File.tmpfile` requires administrator rights on
                    Windows
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com



---
---
import std.stdio;

void main() {
    File.tmpfile();
}
---
dmd 2.058 compiled version running from non-administrator fails with:
std.exception.ErrnoException Could not create temporary file with tmpfile()
(Permission denied) at std\stdio.d(875)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 18 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537


Vladimir Panteleev <thecybershadow gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow gmail.com



19:23:30 PDT ---
File.tmpfile is just a simple wrapper around core.stdc.stdio.tmpfile, so the
issue is with the DMC's C standard library.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 05 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
This is not a bug. It works as intended. Should close.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537




09:03:04 PDT ---
What?? How is this not a bug?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537




PDT ---

 What?? How is this not a bug?
The OS prevents to create the file, so tmpfile() throws an exception. I don't see how this can be considered a bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537




09:10:28 PDT ---
The filename is chosen by the C runtime, not the operating system. It is a bug
in the DigitalMars C runtime. It probably tries to use the hard-coded
%WINDIR%\Temp directory, instead of the user profile directory or %TEMP%.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537




PDT ---
Oh, I just saw the author of the issue. It's not "random Denis".
Anyway, has a bug report been done in DMC C bugzilla ?
Else this one will stay open forever, I'm affraid.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



11:23:55 PDT ---

 The filename is chosen by the C runtime, not the operating system. It is a bug
 in the DigitalMars C runtime. It probably tries to use the hard-coded
 %WINDIR%\Temp directory, instead of the user profile directory or %TEMP%.
Actually, it uses stdio.h's _P_tmpdir, which on Windows is "\\". Did I say that implementation is rather old? I also noticed that Windows 7 does not allow writing to the root directory. XP allowed it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537




11:32:02 PDT ---

 XP allowed it.
You mean, to administrator users? I don't think regular users can create files in the drive root on XP either: http://dump.thecybershadow.net/2d089ee536e35b4a8244f26f36be491c/00000814.png -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 19 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7537


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



12:15:09 PDT ---
I have it fixed in snn.lib now. You can pick it up here:

ftp://ftp.digitalmars.com/dmc.zip

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