|
Re: Proper way to change file permissions in installed files after a bundle install? [message #537510 is a reply to message #534600] |
Wed, 02 June 2010 16:59 |
Robert M. Fuhrer Messages: 294 Registered: July 2009 |
Senior Member |
|
|
Ok, no responses, so far, so let's try this approach instead.
Here's some EFS-based code I came up with that's completely portable:
String path = <filesystem-absolute path to executable>;
IFileSystem fs = EFS.getLocalFileSystem();
IFileStore fStore= fs.getStore(new Path(path));
IFileInfo fInfo= fStore.fetchInfo();
if (! fInfo.getAttribute(EFS.ATTRIBUTE_EXECUTABLE)) {
fInfo.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true);
try {
fStore.putInfo(fInfo, EFS.SET_ATTRIBUTES, null);
} catch (CoreException e) {
logException("Exception encountered when attempting to fix file permissions", e);
}
}
Anyone see anything wrong with this? It seems to work.
On the other hand, it also appears that, on Mac OS, it only sets the owner's permissions (not group or world). I guess it's not entirely unreasonable for the user to have to set the group/world execute bit outside Eclipse.
|
|
|
Powered by
FUDForum. Page generated in 0.03297 seconds