mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-04 22:00:50 +00:00
Create Libnrary directory in correect path.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12535 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e52588fff1
commit
d4759ee45e
1 changed files with 16 additions and 6 deletions
|
@ -572,7 +572,6 @@ static NSString *pathForUser(NSString *user)
|
||||||
NSString *home;
|
NSString *home;
|
||||||
NSString *path;
|
NSString *path;
|
||||||
NSString *old;
|
NSString *old;
|
||||||
NSString *libpath;
|
|
||||||
unsigned desired;
|
unsigned desired;
|
||||||
NSDictionary *attr;
|
NSDictionary *attr;
|
||||||
BOOL isDir;
|
BOOL isDir;
|
||||||
|
@ -634,11 +633,6 @@ static NSString *pathForUser(NSString *user)
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create this path also. The GUI/font cache depends on it being there */
|
|
||||||
libpath = [home stringByAppendingPathComponent: @"Library"];
|
|
||||||
if ([mgr fileExistsAtPath: libpath isDirectory: &isDir] == NO)
|
|
||||||
[mgr createDirectoryAtPath: libpath attributes: attr];
|
|
||||||
|
|
||||||
path = [path stringByAppendingPathComponent: GNU_UserDefaultsDatabase];
|
path = [path stringByAppendingPathComponent: GNU_UserDefaultsDatabase];
|
||||||
old = [home stringByAppendingPathComponent: GNU_UserDefaultsDatabase];
|
old = [home stringByAppendingPathComponent: GNU_UserDefaultsDatabase];
|
||||||
if ([mgr fileExistsAtPath: path] == NO)
|
if ([mgr fileExistsAtPath: path] == NO)
|
||||||
|
@ -657,6 +651,22 @@ static NSString *pathForUser(NSString *user)
|
||||||
NSLog(@"Warning - ignoring old defaults database in %@", old);
|
NSLog(@"Warning - ignoring old defaults database in %@", old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Try to create standard directory hierarchy if necessary
|
||||||
|
*/
|
||||||
|
home = [NSSearchPathForDirectoriesInDomains(NSUserDirectory,
|
||||||
|
NSUserDomainMask, YES) lastObject];
|
||||||
|
if (home != nil)
|
||||||
|
{
|
||||||
|
NSString *p;
|
||||||
|
|
||||||
|
p = [home stringByAppendingPathComponent: @"Library"];
|
||||||
|
if ([mgr fileExistsAtPath: p isDirectory: &isDir] == NO)
|
||||||
|
{
|
||||||
|
[mgr createDirectoryAtPath: p attributes: attr];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue