mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-22 07:43:56 +02:00
[170832] windows implementation for changing to read-write permissions
This commit is contained in:
parent
6fe2830206
commit
0e6e456028
2 changed files with 26 additions and 3 deletions
|
@ -1298,7 +1298,14 @@ private DataElement createDataElementFromLSString(DataElement subject,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
done = false;
|
// windows version
|
||||||
|
String[] cmd = new String[3];
|
||||||
|
cmd[0] = "attrib"; //$NON-NLS-1$
|
||||||
|
cmd[1] = "-R"; //$NON-NLS-1$
|
||||||
|
cmd[2] = filename.getAbsolutePath();
|
||||||
|
Process p = Runtime.getRuntime().exec(cmd);
|
||||||
|
int exitValue = p.waitFor();
|
||||||
|
done = (exitValue == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (done)
|
if (done)
|
||||||
|
|
|
@ -1344,8 +1344,24 @@ public class LocalFileService extends AbstractFileService implements IFileServic
|
||||||
}
|
}
|
||||||
return (exitValue == 0);
|
return (exitValue == 0);
|
||||||
}
|
}
|
||||||
// windows version not implemented yet
|
// windows version
|
||||||
return false;
|
else
|
||||||
|
{
|
||||||
|
String[] cmd = new String[3];
|
||||||
|
cmd[0] = "attrib"; //$NON-NLS-1$
|
||||||
|
cmd[1] = "-R"; //$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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue