------- Comment #2 from [EMAIL PROTECTED]  2008-11-27 17:51 -------

C:\temp>copy /y con test.txt
text <- text must be typed first for the file to be opened.

FileMode.OutNew has the same problem. No sharing mode at all is set in this

Linux/posix systems:

I am fairly sure that the unix code should also have a "share" (really
permission bits) mode of 666 (and not 660), read and write for all occasions.
The processes current umask is then automatically applied to restrict the
actual permission bits. [ the "share" mode, or in actually the mode bits passed
to only apply when creating files ]

Linux example:
0022 (on my system - typical) allows permissions of 655 (rwxr-xr-x) or "less"
normal file creation asks for 666 (everything except execute bit & other
special permissions) yeilding:
$echo test > test.txt
$ls -l test.txt
-rw-r--r-- 1 user user 5 2008-11-27 23:39 test.txt

which is correct.

With D (Incorrect):
$rm test.txt
ls -l test.txt
-rw-r----- 1 user user 5 2008-11-27 23:39 test.txt

read is missing from "others" permission, and so would write be if the umask
was 0020 or similar.

import std.stdio;

void main()
        auto f = new File("test.txt", FileMode.OutNew);
        char[] s;
        s = readln();


Reply via email to