Page 1 of 1

Special Folders for Mac OS

Posted: Tue Oct 11, 2011 7:08 am
by jamirokwai
Hi there,

today, my App was rejected to be added to the Mac App Store because of using the wrong folders for data...
My suggestion is, to add some functions for PB / Mac OS X which will return these strings:

~/Library/Application Support/<app-identifier>
this may be examined this way: GetHomeDirectory() + "/Library/Application Support/" + AppName$ ; e.g. de.quadworks.reisekosten

For Images, Music, and Movies you may use these folders:
~/Pictures/<app-identifier>
~/Music/<app-identifier>
~/Movies/<app-identifier>

On Windows, the appropriate locations are also needed sometimes, I assume ;-)

Re: Special Folders for Mac OS

Posted: Tue Oct 11, 2011 7:35 am
by J. Baker
There already is. Just run this simple line in PureBasic...

Code: Select all

Result$ = GetHomeDirectory()
Debug Result$
But make sure you use the company name and app name if you plan to have more then one app.

Code: Select all

GetHomeDirectory() + "/Library/Application Support/Quadworks/Reisekosten/"
That is if your company name is "quadworks" and your app name is "reisekosten".

Re: Special Folders for Mac OS

Posted: Tue Oct 11, 2011 8:38 am
by ts-soft
J. Baker wrote:

Code: Select all

GetHomeDirectory() + "/Library/Application Support/Quadworks/Reisekosten/"
All results of directoryfunctions in pb ending with a Slash or Backslash :wink:

Code: Select all

GetHomeDirectory() + "Library/Application Support/Quadworks/Reisekosten/"
This should correct.

Greetings - Thomas

Re: Special Folders for Mac OS

Posted: Tue Oct 11, 2011 8:54 am
by jamirokwai
Hi,

yes. I knew, you could add the Library/Application Support/ yourself.
But one native command for all OS would be a nice to have feature.
I am coding on my Mac, and the Windows-exe is more like a "waste product"
as it is possible to compile in a small amount of time.

If you have a command giving back the correct position of data, music,
photo, movie-folder on every os, this would reduce CompilerIfs as they
are present in my Reisekosten-project. Currently, I have to do this:

Code: Select all

CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Windows : Global DatenOrdner$ = GetHomeDirectory() + "quadWorks Reisekosten/"
  CompilerCase #PB_OS_MacOS
    Global DatenOrdner$ = GetHomeDirectory() + "Library/Application Support/quadWorks Reisekosten/"
    Global DokumenteOrdner$ = GetHomeDirectory() + "Documents"
  CompilerCase #PB_OS_Linux   : Global DatenOrdner$ = GetHomeDirectory() + "documents/quadWorks Reisekosten/"
CompilerEndSelect
Instead I would have to to this:

Code: Select all

Global DatenOrdner$ = GetSettingsDirectory() + "quadWorks Reisekosten"
Global DokumenteOrdner$ = GetDocumentsDirectory()
I am not sure, where exactly the Documents lie under Windows xp, Vista, 7 :-)

Re: Special Folders for Mac OS

Posted: Tue Oct 11, 2011 9:10 am
by ts-soft
This directories a not always the same path in all versions of OS. Different windows version, different linux (KDE,
Gnome usw.) and so on. I don't think your wish is realy usefull.

greetings - Thomas