discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: User's GNUstep directory


From: David Chisnall
Subject: Re: User's GNUstep directory
Date: Fri, 18 Sep 2009 16:15:16 +0100

On 18 Sep 2009, at 16:03, Philippe Roussel wrote:

Hi all,

Currently I'm using the hardcoded path @"~/GNUstep/Library/ SimpleAgenda" to save the local calendars users create in SimpleAgenda (if I create a
local agenda called 'private', it will be saved in the file
~/GNUstep/Library/SimpleAgenda/private).

I am wondering if :

- it's a good place to save user data

Yes, it's a good place. Apple tends to favour putting things in Library/Application Support/{AppName} but Library/{AppName} is also fine.

- if there's a better way (not harcoded) to get this directory,
something like [NSApp libraryPath] ?

You want to call:

NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);

This should contain a one-entry NSArray instance containing (the tilde- expanded form of) ~/GNUstep/Library. Then use - stringByAppendingPathComponent: to add the 'private' bit.

David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]