mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 08:26:27 +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
32ac540564
commit
7bd3105385
1 changed files with 16 additions and 6 deletions
|
@ -572,7 +572,6 @@ static NSString *pathForUser(NSString *user)
|
|||
NSString *home;
|
||||
NSString *path;
|
||||
NSString *old;
|
||||
NSString *libpath;
|
||||
unsigned desired;
|
||||
NSDictionary *attr;
|
||||
BOOL isDir;
|
||||
|
@ -634,11 +633,6 @@ static NSString *pathForUser(NSString *user)
|
|||
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];
|
||||
old = [home stringByAppendingPathComponent: GNU_UserDefaultsDatabase];
|
||||
if ([mgr fileExistsAtPath: path] == NO)
|
||||
|
@ -657,6 +651,22 @@ static NSString *pathForUser(NSString *user)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue