mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Improve errors for copying.
This commit is contained in:
parent
303a6eb975
commit
f6c0c5a5c0
2 changed files with 12 additions and 4 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,4 +1,9 @@
|
|||
2024-23-09: Hugo Melder <hugo@algoriddim.com>
|
||||
2024-10-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSFileManager.m: Create an NSError object when we fail to
|
||||
copy because the destination item already exists.
|
||||
|
||||
2024-09-23: Hugo Melder <hugo@algoriddim.com>
|
||||
|
||||
* Headers/Foundation/NSThread.h:
|
||||
* Source/NSString.m:
|
||||
|
@ -6,14 +11,14 @@
|
|||
Cache ICU collator in thread-local storage to avoid
|
||||
expensive construction when comparing strings.
|
||||
|
||||
2024-13-08: Hugo Melder <hugo@algoriddim.com>
|
||||
2024-08-13: Hugo Melder <hugo@algoriddim.com>
|
||||
|
||||
* Source/NSOperation.m:
|
||||
* Headers/Foundation/NSOperation.h:
|
||||
Give NSOperationQueue worker threads a proper thread
|
||||
name for easy identification.
|
||||
|
||||
2024-12-08 Hugo Melder <hugo@algoriddim.com>
|
||||
2024-08-12 Hugo Melder <hugo@algoriddim.com>
|
||||
* Source/NSThread.m:
|
||||
Fix threadPriority and setThreadPriority: on Android.
|
||||
|
||||
|
|
|
@ -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…
Reference in a new issue