preparation for osx compatibility fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35390 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2012-08-10 08:36:09 +00:00
parent b618b41512
commit 897390797f
10 changed files with 66 additions and 16 deletions

View file

@ -1,3 +1,16 @@
2012-08-10 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSSpellServer.m:
* Source/NSPropertyList.m:
* Source/NSPathUtilities.m:
* Source/NSUserDefaults.m:
* Source/NSMessagePortNameServer.m:
* Source/NSDistributedLock.m:
* Source/NSMessagePort.m:
* Source/NSHTTPCookieStorage.m:
Use new method for creating intermediate directories rater than
depending on incorrect behavior of the old method.
2012-08-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSPropertyList.m:

View file

@ -192,7 +192,9 @@ static NSFileManager *mgr = nil;
forKey: NSFilePosixPermissions];
locked = [mgr createDirectoryAtPath: _lockPath
attributes: attributesToSet];
withIntermediateDirectories: YES
attributes: attributesToSet
error: NULL];
if (locked == NO)
{
BOOL dir;
@ -206,7 +208,9 @@ static NSFileManager *mgr = nil;
if ([mgr fileExistsAtPath: _lockPath isDirectory: &dir] == NO)
{
locked = [mgr createDirectoryAtPath: _lockPath
attributes: attributesToSet];
withIntermediateDirectories: YES
attributes: attributesToSet
error: NULL];
if (locked == NO)
{
NSLog(@"Failed to create lock directory '%@' - %@",

View file

@ -126,8 +126,11 @@ static NSHTTPCookieStorage *storage = nil;
fileExistsAtPath: path isDirectory: &isDir] == NO || isDir == NO)
{
BOOL ok;
ok = [[NSFileManager defaultManager] createDirectoryAtPath: path
withIntermediateDirectories: YES attributes: nil error: NULL];
withIntermediateDirectories: YES
attributes: nil
error: NULL];
if (ok == NO)
return nil;
}

View file

@ -1196,11 +1196,15 @@ typedef struct {
path = [path stringByAppendingPathComponent: @"NSMessagePort"];
[[NSFileManager defaultManager] createDirectoryAtPath: path
attributes: attr];
withIntermediateDirectories: YES
attributes: attr
error: NULL];
path = [path stringByAppendingPathComponent: @"ports"];
[[NSFileManager defaultManager] createDirectoryAtPath: path
attributes: attr];
withIntermediateDirectories: YES
attributes: attr
error: NULL];
M_LOCK(messagePortLock);
path = [path stringByAppendingPathComponent:

View file

@ -278,11 +278,15 @@ static void clean_up_names(void)
path = [path stringByAppendingPathComponent: @"NSMessagePort"];
[[NSFileManager defaultManager] createDirectoryAtPath: path
attributes: attr];
withIntermediateDirectories: YES
attributes: attr
error: NULL];
path = [path stringByAppendingPathComponent: @"names"];
[[NSFileManager defaultManager] createDirectoryAtPath: path
attributes: attr];
withIntermediateDirectories: YES
attributes: attr
error: NULL];
base_path = RETAIN(path);
}

View file

@ -682,7 +682,10 @@ static void ExtractValuesFromConfig(NSDictionary *config)
if ([manager fileExistsAtPath: path isDirectory: &flag] == NO
|| flag == NO)
{
[manager createDirectoryAtPath: path attributes: attr];
[manager createDirectoryAtPath: path
withIntermediateDirectories: YES
attributes: attr
error: NULL];
}
}
@ -2005,7 +2008,9 @@ NSTemporaryDirectory(void)
attr = [NSDictionary dictionaryWithObject: p
forKey: NSFilePosixPermissions];
if ([manager createDirectoryAtPath: tempDirName
attributes: attr] == NO)
withIntermediateDirectories: YES
attributes: attr
error: NULL] == NO)
{
NSWarnFLog(@"Attempt to create a secure temporary"
@" directory (%@) failed.", tempDirName);

View file

@ -467,8 +467,10 @@ foundIgnorableWhitespace: (NSString *)string
unsigned int *table;
}
+ (void) serializePropertyList: (id)aPropertyList intoData: (NSMutableData *)destination;
- (id) initWithPropertyList: (id)aPropertyList intoData: (NSMutableData *)destination;
+ (void) serializePropertyList: (id)aPropertyList
intoData: (NSMutableData *)destination;
- (id) initWithPropertyList: (id)aPropertyList
intoData: (NSMutableData *)destination;
- (void) generate;
- (void) storeObject: (id)object;
- (void) cleanup;

View file

@ -209,7 +209,10 @@ GSSpellServerName(NSString *vendor, NSString *language)
else
{
// The directory does not exist create it.
if ([mgr createDirectoryAtPath: dirPath attributes: nil])
if ([mgr createDirectoryAtPath: dirPath
withIntermediateDirectories: YES
attributes: nil
error: NULL])
{
// Directory created. Now create the empty file.
NSArray *emptyDict = [NSArray array];

View file

@ -163,7 +163,10 @@ lockPath(NSString *defaultsDatabase, BOOL verbose)
if ([mgr fileExistsAtPath: path isDirectory: &isDir] == NO)
{
if ([mgr createDirectoryAtPath: path attributes: attr] == NO)
if ([mgr createDirectoryAtPath: path
withIntermediateDirectories: YES
attributes: attr
error: NULL] == NO)
{
if (verbose)
NSLog(@"Defaults path '%@' does not exist - failed to create it.",
@ -186,7 +189,10 @@ lockPath(NSString *defaultsDatabase, BOOL verbose)
path = [path stringByAppendingPathComponent: @".lck"];
if ([mgr fileExistsAtPath: path isDirectory: &isDir] == NO)
{
if ([mgr createDirectoryAtPath: path attributes: attr] == NO)
if ([mgr createDirectoryAtPath: path
withIntermediateDirectories: YES
attributes: attr
error: NULL] == NO)
{
if (verbose)
NSLog(@"Defaults path '%@' does not exist - failed to create it.",

View file

@ -913,7 +913,10 @@ main(int argc, char **argv, char **env)
if ([documentationDirectory length] > 0
&& [mgr fileExistsAtPath: documentationDirectory] == NO)
{
[mgr createDirectoryAtPath: documentationDirectory attributes: nil];
[mgr createDirectoryAtPath: documentationDirectory
withIntermediateDirectories: YES
attributes: nil
error: NULL];
}
symbolDeclsFile = [documentationDirectory
@ -2359,7 +2362,10 @@ main(int argc, char **argv, char **env)
file = [stamp stringByDeletingLastPathComponent];
if ([file length]> 0 && [mgr fileExistsAtPath: file] == NO)
{
[mgr createDirectoryAtPath: file attributes: nil];
[mgr createDirectoryAtPath: file
withIntermediateDirectories: YES
attributes: nil
error: NULL];
}
[depend writeToFile: stamp atomically: YES];
}