It is currently Wed Jun 19, 2013 3:29 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Special Folders for Mac OS
PostPosted: Tue Oct 11, 2011 7:08 am 
Offline
Enthusiast
Enthusiast

Joined: Tue May 20, 2008 2:12 am
Posts: 650
Location: Cologne, Germany
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

---
5.10-x64/x86 - MacBook Pro, Mountain Lion
My Blog (German): http://www.quadworks.de


Top
 Profile  
 
 Post subject: Re: Special Folders for Mac OS
PostPosted: Tue Oct 11, 2011 7:35 am 
Offline
Addict
Addict
User avatar

Joined: Sun Apr 27, 2003 8:12 am
Posts: 1624
Location: USA
There already is. Just run this simple line in PureBasic...
Code:
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:
GetHomeDirectory() + "/Library/Application Support/Quadworks/Reisekosten/"

That is if your company name is "quadworks" and your app name is "reisekosten".

_________________
AMD 64 4000+ / 1GB PC2700 / WIN XP Home SP3 / Nvidia GT220 x16 512MB / M-Audio Revolution 5.1
Macbook Air 11.6" - 2010 / OS X 10.8

http://www.posemotion.com
http://www.flashpulse.com


Top
 Profile  
 
 Post subject: Re: Special Folders for Mac OS
PostPosted: Tue Oct 11, 2011 8:38 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
J. Baker wrote:
Code:
GetHomeDirectory() + "/Library/Application Support/Quadworks/Reisekosten/"


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

This should correct.

Greetings - Thomas

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: Special Folders for Mac OS
PostPosted: Tue Oct 11, 2011 8:54 am 
Offline
Enthusiast
Enthusiast

Joined: Tue May 20, 2008 2:12 am
Posts: 650
Location: Cologne, Germany
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:
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:
Global DatenOrdner$ = GetSettingsDirectory() + "quadWorks Reisekosten"
Global DokumenteOrdner$ = GetDocumentsDirectory()


I am not sure, where exactly the Documents lie under Windows xp, Vista, 7 :-)

_________________
Regards,
JamiroKwai

---
5.10-x64/x86 - MacBook Pro, Mountain Lion
My Blog (German): http://www.quadworks.de


Top
 Profile  
 
 Post subject: Re: Special Folders for Mac OS
PostPosted: Tue Oct 11, 2011 9:10 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
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.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye