Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Aug 19, 2018 2:55 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Allowed File Locations
PostPosted: Wed Oct 31, 2012 5:57 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
I know this has been posted else where in this Forum, but I cannot seem to find a topic that addresess this in its entireity.

Under Lion (or perhaps Mt.Lion would be more accurate).
Exactly WHERE can I as a RS developer have my app write things such as Preferences (not in Plist format [don't ask]), database files, external documents etc...

And conversely... where can I NOT (or shouldn't write them).

I'm not going for the Apple Store (yet).... but I want to at least make sure I'm consistent with future requirements.

Would appreciate it if someone could post a topic describing the requirements in a easy format... such as

I'm mostly talking about Shared/Users ~/Library and other such locations as currently defined by SPECIALFOLDERS

Quote:
Databases can be created in XXX and YYY

ZZZ is off-limits


instead of a link to an Apple webpage that requires interpetation (never have figured why they can't write in English :) )

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Allowed File Locations
PostPosted: Wed Oct 31, 2012 7:11 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
you can create files in ~/Library/Application Support/<your app name>/

other than that you may run into issues UNLESS the user has selected it as the location to save a document/file created by your application

You should NOT write directly to the preferences - rather use CFPreferences or NSUserDefaults (available in MacOSLib & MBS plugins) and the API's they expose for you to use. They then call the OS functions that write to "the correct location in the correct way"

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Allowed File Locations
PostPosted: Thu Nov 01, 2012 12:45 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
So it is "ok" to write to

SpecialFolders.ApplicationData.child("app name")

I "assume" it is ok to write to these as well.... otherwise what would the purpose be?

SpecialFolders.Documents
SpecialFolders.SharedDocuments
SpecialFolders.Pictures
SpecialFolders.Temporary

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Allowed File Locations
PostPosted: Thu Nov 01, 2012 1:22 pm 
Offline

Joined: Mon May 30, 2011 12:56 am
Posts: 702
Quote:
So it is "ok" to write to
SpecialFolders.ApplicationData.child("app name")


At the moment. Ive spent quite a while over the last few years playing 'chase the happy location' !
You need to know that while this works, Mac and Windows, on the Mac they hide this folder from the user now.
Its get-atable with a bit of work, but dont put anything in there that the user can be expected to just browse to and use.
You would need to expose an access method via your app.


Quote:
I "assume" it is ok to write to these as well.... otherwise what would the purpose be?


SpecialFolders.SharedDocuments
SpecialFolders.Pictures
SpecialFolders.Temporary



Yes.

SpecialFolders.Documents.child("myApp") for documents your users create as new.
SpecialFolders.Temporary for files you need for a while but don't mind losing. (nothing to stop you deleting them on exit: pity more apps don't...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group