If the Library directory is not found, create one for the user.

This commit is contained in:
Riccardo Mottola 2020-06-18 07:58:01 +00:00
parent c5990ed022
commit 9a46ea9160
2 changed files with 17 additions and 1 deletions

View file

@ -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

View file

@ -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"];