Improve archiving on full disks

This commit is contained in:
Richard Frith-Macdonald 2018-04-05 15:31:27 +01:00
parent 18653e0506
commit 3b29353dd8
2 changed files with 14 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2018-04-05 Richard Frith-Macdonald <rfm@gnu.org>
* EcCommand.m: Do not try to compress old debug files if there is
not enough space on the filesystem for both the uncompressed and
compressed versions to co-exist while compressing. Instead delete
the file and generate an error message.
2018-03-08 Richard Frith-Macdonald <rfm@gnu.org>
* EcControl.m: Allow EcControlKeyTest to be defined to supply a key

View file

@ -2642,6 +2642,13 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
[mgr removeFileAtPath: src handler: nil];
continue; // Nothing to compress
}
if ([a fileSize] >= [[[mgr fileSystemAttributesAtPath: src]
objectForKey: NSFileSystemFreeSize] integerValue])
{
[mgr removeFileAtPath: src handler: nil];
[self cmdError: @"Unable to compress %@ (too big; deleted)", src];
continue; // Not enough space free to compress
}
dst = [src stringByAppendingPathExtension: @"gz"];
if ([mgr fileExistsAtPath: dst isDirectory: &isDirectory] == YES)