Submitted On 28-JAN-1998
smithmd
This is the only feature keeping our product from being 100% Java.
Submitted On 24-FEB-1998
phreger
On a Windows 95 system, you can use a wrapper around \windows\command.com:
private boolean changeReadOnly( File dir, String filespec, boolean makeRO )
{
Runtime rt;
Process proc;
int exitcode;
String dirpath;
String[] attrib = new String[2];
attrib[0] = "c:\\windows\\command\\attrib.exe";
if ( makeRO )
attrib[1] = "+R";
else
attrib[1] = "-R";
try
{
dirpath = dir.getCanonicalPath();
attrib[1] = attrib[1] + " \"" + dirpath + "\\" +
filespec + "\"";
rt = Runtime.getRuntime();
proc = rt.exec( attrib );
proc.waitFor();
exitcode = proc.exitValue();
}
catch( Exception e )
{
return( false );
}
return( exitcode == 0 );
}
Submitted On 02-MAR-1998
eric@csfactory.com
How unfortunate that this bug gets so few votes.
We really, really need this to be 100% Java.
Seems like such an obvious feature, it's odd that
it was omitted. Please add the feature as soon
as possible.
Submitted On 16-APR-1998
madmax
This is one feature which is badly lacking in otherwise
good language like java.Without this feature the funtionality of java in file
I/O is limited.I suggest that this feature be added immediately.
Submitted On 16-JUN-1998
mconda
Don't want to have to handle file permissions per native platform. It seems
logical to have such a feature in File I/O. Please consider implementing.
Submitted On 24-JUN-1998
tedd
Note that the workarounds for this bug, using native methods and/or
Runtime.exec() both prevent apps from being certified as Pure Java. This is a
significant omission stifles a lot of development.
Submitted On 13-AUG-1998
smithmd
When using the work-around specified (attrib.exe) & an application like MS
Word has the file open the runtime process hangs because of a prompt
associated with the attrib command. This occurs on Windows 95 and not Windows
NT. Have not tested Windows 98.
Test:
1. Open a writable ".doc" file
2. In a command prompt enter "attrib <filename> +r"
3. You will receive the following response -
Sharing violation... abort, retry, fail?
Note: same thing happens with a read-only file & -r
4. The process hangs around until the machine is rebooted. One process for
every time this occurs!
Submitted On 03-NOV-1998
JasonPenney
It should also be possible to modify a file so
that (if supported) it is readable/writable only
by the owner. Consider, for instance, the ~/.keystore
file created by keytool.
Submitted On 29-OCT-1999
f0xtr0t
What can I say that hasn't been said? I am stunned that this does not exist. It
is a royal pain in the behind.
Submitted On 27-SEP-2000
srosburg
We develop a product on both NT and Solaris. There is no
way I can even use the Runtime.exec() "workaround" without
supporting both attrib and chmod (and thus forcing
knowledge of what platform I am running on). I can't
believe this feature is still not in the language, need I
say more?
Submitted On 05-APR-2001
amlngai
I am writing code which modifies Unix shell scripts. Need
functionality of ensuring that the resulting file has
executable permission.
Submitted On 06-APR-2001
ameasures
Trying to port away from J++ and its native
calls into Win32.
It seems a file can be set "readonly" but
once done, it CANNOT then be set "readwrite".
This should have been sorted by now !
I guess the work around to do some sort
of "copy, delete, rename" kludge.
Sorry but it is kinda frustrating ...
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|