Special Folders for Mac OS

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Special Folders for Mac OS

Post 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 ;-)
Regards,
JamiroKwai
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: Special Folders for Mac OS

Post 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".
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Special Folders for Mac OS

Post 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
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Special Folders for Mac OS

Post 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 :-)
Regards,
JamiroKwai
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Special Folders for Mac OS

Post 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
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply