mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Improve errors for copying.
This commit is contained in:
parent
303a6eb975
commit
f6c0c5a5c0
2 changed files with 12 additions and 4 deletions
|
@ -1338,11 +1338,13 @@ static gs_mutex_t classLock = GS_MUTEX_INIT_STATIC;
|
|||
|
||||
if ([self fileExistsAtPath: destination] == YES)
|
||||
{
|
||||
[self _setLastError: @"Could not copy - destination already exists"];
|
||||
return NO;
|
||||
}
|
||||
attrs = [self fileAttributesAtPath: source traverseLink: NO];
|
||||
if (attrs == nil)
|
||||
{
|
||||
[self _setLastError: @"Cound not copy - destination is not readable"];
|
||||
return NO;
|
||||
}
|
||||
fileType = [attrs fileType];
|
||||
|
@ -1368,7 +1370,8 @@ static gs_mutex_t classLock = GS_MUTEX_INIT_STATIC;
|
|||
if ([[destination stringByAppendingString: @"/"]
|
||||
hasPrefix: [source stringByAppendingString: @"/"]])
|
||||
{
|
||||
[self _setLastError: @"Could not copy - destination is a descendant of source"];
|
||||
[self _setLastError:
|
||||
@"Could not copy - destination is a descendant of source"];
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue