re-enabled srm for system that still support it

This commit is contained in:
michael starke
2016-11-11 19:35:19 +01:00
parent c9662865e1
commit ba80944c6b

View File

@@ -118,8 +118,22 @@
+ (void)_runCleanupForPath:(NSString *)path {
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/bin/rm"];
[task setArguments:@[@"-P", path]];
NSURL *srmURL = [NSURL fileURLWithPath:@"/usr/bin/srm"];
NSURL *rmURL = [NSURL fileURLWithPath:@"/bin/rm"];
if([srmURL checkResourceIsReachableAndReturnError:nil]) {
task.launchPath = srmURL.path;
task.arguments = @[@"-m", path];
}
else if([rmURL checkResourceIsReachableAndReturnError:nil]) {
task.launchPath = rmURL.path;
task.arguments= @[@"-P", path];
}
else {
NSLog(@"Unable to retrieve remove command to whipe temporary file storage!");
return;
}
[task launch];
[task waitUntilExit];
}