The canonical implementation of creation in POSIX systems is to open with
maximal permission (usually 777 or 666) and let umask clear what the user
wants to clear. You should not assume that people want their files and/or
directories protected or not protected from "other". Turn on all the bits
and let umask sort 'em out.
java_io_File_mkdir0 uses 771
java_io_FileOutputStream_open uses 664
java_io_FileOutputStream_openAppend uses 664
java_io_RandomAccessFile_open users 664
in src/share/sun/jio/jio.c, jio_open uses 644
in src/solaris/doc/java/native/file.c, demo_OutputFile_open uses 644
in src/solaris/java/javai/javai.c, OpenCode uses 644 twice
in src/solaris/java/javap/javap.c, OpenCode uses 644
in src/win32/bin/hotjava.c, main uses 644
ken.arnold@East 1998-01-07
This is still a problem, and is causing problems in our development environment where javac creates directories with the wrong mode. This is just not the right
mapping for UNIX -- UNIX custom is to create with all reasonable permissions on and let umask sort it out. This is a simple thing to fix -- surely we can get it into 1.2?
maximal permission (usually 777 or 666) and let umask clear what the user
wants to clear. You should not assume that people want their files and/or
directories protected or not protected from "other". Turn on all the bits
and let umask sort 'em out.
java_io_File_mkdir0 uses 771
java_io_FileOutputStream_open uses 664
java_io_FileOutputStream_openAppend uses 664
java_io_RandomAccessFile_open users 664
in src/share/sun/jio/jio.c, jio_open uses 644
in src/solaris/doc/java/native/file.c, demo_OutputFile_open uses 644
in src/solaris/java/javai/javai.c, OpenCode uses 644 twice
in src/solaris/java/javap/javap.c, OpenCode uses 644
in src/win32/bin/hotjava.c, main uses 644
ken.arnold@East 1998-01-07
This is still a problem, and is causing problems in our development environment where javac creates directories with the wrong mode. This is just not the right
mapping for UNIX -- UNIX custom is to create with all reasonable permissions on and let umask sort it out. This is a simple thing to fix -- surely we can get it into 1.2?
- duplicates
-
JDK-4124477 java.io.File mkdir makes directories with mode 771 - should be 775
- Closed
-
JDK-4131839 java.io.File.mkdir() ignores umask
- Closed