How to find Library path
Archives Forums/MacOS X Discussion/How to find Library path
| ||
I need to save my profiles and settings to: ~/Library/Application Support or ~Library/Preferences folder (within the user’s home library). The full path is: Macintosh HD/Users/Username/Library/ApplicationSupport/StudioName/GameTitle Or: Macintosh HD/Users/Username/Library/Preferences/StudioName/GameTitle How do I retrieve these folders on MacOS from blitzmax? |
| ||
found this topic: http://www.blitzbasic.com/Community/posts.php?topic=42019 and i think it is what i need |
| ||
Is the Libary folder still called "Library" on a non-English version of OSX? |
| ||
Actually, never mind. Just modified the code coupled with some googling and the code below now returns the user's Library/Application Support folder path:?macOS Const kUserDomain=-32763 Const kApplicationSupportFolderType=Asc("a") Shl 24 | Asc("s") Shl 16 | Asc( "u") Shl 8 | Asc("p") Extern Function FSFindFolder( vRefNum,folderType,createFolder,foundRef:Byte Ptr ) Function FSRefMakePath( ref:Byte Ptr,path:Byte Ptr,maxPathsize ) End Extern Function OSX_AppSupportDir$() Local buf:Byte[1024],ref:Byte[80] If FSFindFolder( kUserDomain, kApplicationSupportFolderType,False,ref ) Return If FSRefMakePath( ref,buf,1024 ) Return Return String.FromCString( buf ) End Function ? |