mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +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
|
||||
{
|
||||
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)
|
||||
|
|
|
@ -1344,8 +1344,24 @@ public class LocalFileService extends AbstractFileService implements IFileServic
|
|||
}
|
||||
return (exitValue == 0);
|
||||
}
|
||||
// windows version not implemented yet
|
||||
return false;
|
||||
// windows version
|
||||
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