Apply patch by Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36272 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-03-05 12:27:20 +00:00
parent 825ae282a4
commit 75f5788037
4 changed files with 39 additions and 28 deletions

View file

@ -1,4 +1,14 @@
2012-03-05 Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
* Source/NSFileManager.m:
* Headers/Foundation/NSFileManager.h:
([createDirectoryAtURL:withIntermediateDirectories:attributes:error:])
implemented.
Also, for OSX compatibility, RFM 'fixed' the ...error: methods to
leave the error value unmodified in the case where no error occurs.
2012-03-03 Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
* Source/NSKeyValueObserving.m
* Source/NSXMLParser.m
char is unsigned on macppc, so don't compare it

View file

@ -189,6 +189,7 @@ extern "C" {
@class NSEnumerator;
@class NSDirectoryEnumerator;
@class NSError;
@class NSURL;
/* MacOS-X defines OSType as a 32bit unsigned integer.
*/
@ -255,6 +256,10 @@ typedef uint32_t OSType;
withIntermediateDirectories: (BOOL)flag
attributes: (NSDictionary *)attributes
error: (NSError **) error;
- (BOOL) createDirectoryAtURL: (NSURL *)url
withIntermediateDirectories: (BOOL)flag
attributes: (NSDictionary *)attributes
error: (NSError **) error;
- (BOOL) createDirectoryAtPath: (NSString*)path
attributes: (NSDictionary*)attributes;
- (BOOL) createFileAtPath: (NSString*)path

View file

@ -28,7 +28,7 @@
#import "Foundation/NSError.h"
#import "Foundation/NSCoder.h"
NSString* const NSFilePathErrorKey = @"NSFilePathErrorKey";
NSString* const NSFilePathErrorKey = @"NSFilePath";
NSString* const NSLocalizedDescriptionKey = @"NSLocalizedDescriptionKey";
NSString* const NSStringEncodingErrorKey = @"NSStringEncodingErrorKey";
NSString* const NSURLErrorKey = @"NSURLErrorKey";

View file

@ -58,6 +58,7 @@
#import "Foundation/NSPathUtilities.h"
#import "Foundation/NSProcessInfo.h"
#import "Foundation/NSSet.h"
#import "Foundation/NSURL.h"
#import "Foundation/NSValue.h"
#import "GSPrivate.h"
#import "GNUstepBase/NSObject+GNUstepBase.h"
@ -716,10 +717,6 @@ static NSStringEncoding defaultEncoding;
{
*error = [self _errorFrom: path to: nil];
}
else
{
*error = nil;
}
}
return result;
@ -780,15 +777,30 @@ static NSStringEncoding defaultEncoding;
{
*error = [self _errorFrom: path to: nil];
}
else
{
*error = nil;
}
}
return result;
}
/**
* Creates a new directory and all intermediate directories in the file URL
* if flag is YES.
* Creates only the last directory in the URL if flag is NO.<br />
* The directory is created with the attributes
* specified in attributes and any error is returned in error.<br />
* returns YES on success, NO on failure.
*/
- (BOOL) createDirectoryAtURL: (NSURL *)url
withIntermediateDirectories: (BOOL)flag
attributes: (NSDictionary *)attributes
error: (NSError **) error
{
return [self createDirectoryAtPath: [url path]
withIntermediateDirectories: flag
attributes: attributes
error: error];
}
/**
* Creates a new directory, and sets its attributes as specified.<br />
* Fails if directories in the path are missing.<br />
@ -1128,10 +1140,6 @@ static NSStringEncoding defaultEncoding;
{
*error = [self _errorFrom: src to: dst];
}
else
{
*error = nil;
}
}
return result;
@ -1239,10 +1247,6 @@ static NSStringEncoding defaultEncoding;
{
*error = [self _errorFrom: src to: dst];
}
else
{
*error = nil;
}
}
return result;
@ -1485,10 +1489,6 @@ static NSStringEncoding defaultEncoding;
{
*error = [self _errorFrom: path to: nil];
}
else
{
*error = nil;
}
}
return result;
@ -1906,10 +1906,6 @@ static NSStringEncoding defaultEncoding;
{
*error = [self _errorFrom: path to: nil];
}
else
{
*error = nil;
}
}
return d;
@ -2983,7 +2979,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
@selector (fileManager:shouldProceedAfterError:)])
{
NSDictionary *errorInfo = [NSDictionary dictionaryWithObjectsAndKeys:
path, @"Path",
path, NSFilePathErrorKey,
error, @"Error", nil];
return [handler fileManager: self
shouldProceedAfterError: errorInfo];
@ -3001,7 +2997,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
@selector (fileManager:shouldProceedAfterError:)])
{
NSDictionary *errorInfo = [NSDictionary dictionaryWithObjectsAndKeys:
path, @"Path",
path, NSFilePathErrorKey,
fromPath, @"FromPath",
toPath, @"ToPath",
error, @"Error", nil];
@ -3044,7 +3040,7 @@ static inline void gsedRelease(GSEnumeratedDirectory X)
else if (fromPath)
{
errorInfo = [NSDictionary dictionaryWithObjectsAndKeys:
fromPath, @"Path",
fromPath, NSFilePathErrorKey,
message, NSLocalizedDescriptionKey,
nil];
}