1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 20:45:22 +02:00

new API IFileService.setReadOnly()

This commit is contained in:
David McKnight 2007-01-17 18:19:38 +00:00
parent 74822bd918
commit 5855d743b6

View file

@ -1326,7 +1326,25 @@ public class LocalFileService extends AbstractFileService implements IFileServic
}
else
{
// not implemented yet
if (!_isWindows)
{
// make this read-write
String[] cmd = new String[3];
cmd[0] = "chmod"; //$NON-NLS-1$
cmd[1] = "a+w"; //$NON-NLS-1$
cmd[2] = file.getAbsolutePath();
int exitValue = -1;
try
{
Process p = Runtime.getRuntime().exec(cmd);
exitValue = p.waitFor();
}
catch (Exception e)
{
}
return (exitValue == 0);
}
// windows version not implemented yet
return false;
}
}