mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 23:42:16 +00:00
If the Library directory is not found, create one for the user.
This commit is contained in:
parent
c5990ed022
commit
9a46ea9160
2 changed files with 17 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2020-06-18 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Tools/font_cacher.m:
|
||||
If the Library directory is not found, create one for the user.
|
||||
|
||||
2020-06-18 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Source/xlib/XGFontManager.m
|
||||
|
|
|
@ -191,9 +191,20 @@
|
|||
}
|
||||
|
||||
mgr = [NSFileManager defaultManager];
|
||||
if ([mgr fileExistsAtPath: path] == NO)
|
||||
{
|
||||
NSError *err;
|
||||
BOOL r;
|
||||
r = [mgr createDirectoryAtPath: path
|
||||
withIntermediateDirectories: YES
|
||||
attributes: nil
|
||||
error: &err];
|
||||
if (r == NO)
|
||||
NSLog(@"font_cacher: Library directory creation error: %@", err);
|
||||
}
|
||||
if ([mgr fileExistsAtPath: path isDirectory: &flag] == NO || flag == NO)
|
||||
{
|
||||
NSLog(@"Library directory '%@' not available!", path);
|
||||
NSLog(@"font_cacher: Library directory '%@' not available!", path);
|
||||
return nil;
|
||||
}
|
||||
path = [path stringByAppendingPathComponent: @"Fonts"];
|
||||
|
|
Loading…
Reference in a new issue