1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-22 15:53:58 +02:00

[170832] windows implementation for changing to read-write permissions

This commit is contained in:
David McKnight 2007-01-19 18:11:13 +00:00
parent 6fe2830206
commit 0e6e456028
2 changed files with 26 additions and 3 deletions

View file

@ -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)

View file

@ -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);
}
} }
} }