New Command: GetBundlePath() - only Mac

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

New Command: GetBundlePath() - only Mac

Post by michel51 »

Because all filesystem commands are pointing into the bundle on Mac, I wish to have a command, that returns the Bundlepath = the path where the bundle is in. For example: If I have a executable like "test.app" (that's a bundle) and the whole path of this application is "users/programms/private/test.app", then the command "GetBundlePath()" has to return "users/programms/private/"

That is from the result the same als "GetCurrentDirectory()" on Windows.

I will use it for calling files outside the bundle (like purebasic itself! "Help", "Examples" and others are OUTSIDE the bundle).
For example catalog folders or others.

OK, I can "calculate" the bundlepath with the implemented commands (GetFilePath, GetPathPart, GetCurrenDirectory and some string manipulating commands), but to get this path in a direct way would be more easy and better.
And of course, this will be a command only for Mac, because the other Osses don't have a bundle. For crossplatform programming we have to put it into a compilerif-construct.

Sorry for my bad english, hope you understand.
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta