summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-08 15:59:43 +0000
committerrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-08 15:59:43 +0000
commit04c737bcffd1ed1f16b33c2a4199497c881c8502 (patch)
tree0e114831cebb45cc282776badb87c5f534f25f9a /src/common
parent14a4000aa9056d2fdc69c2dc925bc9a4203d068b (diff)
GTK: Use glib for directory creation.
NSFileManager's createDirectory methods do not appear to work properly on Windows. git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@358 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'src/common')
-rw-r--r--src/common/SupportDir.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/SupportDir.m b/src/common/SupportDir.m
index 72acbf9..c014f4d 100644
--- a/src/common/SupportDir.m
+++ b/src/common/SupportDir.m
@@ -47,11 +47,17 @@
}
+ (void)createUserSupportDir {
+#ifdef __APPLE__
NSFileManager *fileManager = [NSFileManager defaultManager];
+ NSError *error = nil;
[fileManager createDirectoryAtPath:[SupportDir userSupportDir]
withIntermediateDirectories:YES
attributes:nil
error:NULL];
+#else
+ // NSFileManager is slightly dodgy on Windows
+ g_mkdir_with_parents ([[SupportDir userSupportDir] UTF8String], 700);
+#endif
}
@end