• Welcome to the new forum! We upgraded our forum software with a host of new boards, capabilities and features. It is also more secure.
    Jump in and join the conversation! You can learn more about the upgrade and new features here.

Mac OS X - BS tries to create its subdirectory in system tree and fails

zgoda

Apprentice
Joined
Sep 14, 2010
Messages
16
Reaction score
0
While trying to run BS2.0 installed "the Mac way" (drag app to Applications folder from within mounted disk image) i keep getting errors:

22:35:48: Directory '/Library/Application Support/BeerSmith2/' couldn't be created (error 13: Permission denied)
22:35:48: Directory '/Library/Application Support/BeerSmith2/' couldn't be created (error 13: Permission denied)
22:35:48: can't open file '/Library/Application Support/BeerSmith2/bsopts.bsmx' (error 2: No such file or directory)
 

BeerSmith

Staff member
Administrator
Grandmaster Brewer
Joined
Apr 5, 2003
Messages
5,889
Reaction score
67
Location
Virginia
Thanks,
  I have not seen this one before - but if you would be kind enough to simply create the path and give yourself permissions to write to that directory it should correct the error.

  Technically (I believe) that is a valid path for the program to create as that is where application data is supposed to be stored.  I'm not sure why your permissions do not allow it to be created.

Brad
 

zgoda

Apprentice
Joined
Sep 14, 2010
Messages
16
Reaction score
0
Because i run this program as an ordinary (non-root) user, i do not have permissions to create subdirectories in system tree (the /Library... and so on). The configuration written in system tree will be common for all users on this computer (me, my wife and my daughter - all my family uses this computer from time to time) and can be overriden by them. The configuration for particular user should be saved in "$HOME/Library/Application Support" - generally on unix-like systems it's not safe to assume the user can create files and directories anywhere outside his home directory.
 

clasley

New Forum Member
Joined
Dec 28, 2009
Messages
1
Reaction score
0
I'm experiencing the same error.  My shared home machine is setup similar to zgoda's with a single root user and a few non-root users.  My root user account didn't get the error.

-Chris
 

SleepySamSlim

Grandmaster Brewer
Joined
Dec 10, 2008
Messages
277
Reaction score
0
Location
North of Kalifornia
Brad

I have the same issue and zgodas explanation is right on. I also choose to run my mac the "right way" where my daily use account is a standard user not an admin account. I got the attached errors when I started BSmith in my main account. When I switched to my admin account BSmith launched without any errors and created the file. However --- that file should created in each users home directory library NOT in the system library. Also ... even after I ran BSmith as an admin (creating the file) - I went back and tried to run BSmith in my non-admin account and got the same errors. Most likely because BSmith was trying to modify a file in the MAIN LIBRARY not my LOCAL LIBRARY. This is standard functioning for a UNIX - LINUX OS. Any support files for an application are located within each users space where they can be modified by the app when the user runs the app.
 

Attachments

  • Screen shot 2011-06-10 at 6.35.46 PM.jpg
    Screen shot 2011-06-10 at 6.35.46 PM.jpg
    31.8 KB · Views: 726
  • Screen shot 2011-06-10 at 6.36.21 PM.jpg
    Screen shot 2011-06-10 at 6.36.21 PM.jpg
    38.3 KB · Views: 703
  • Screen shot 2011-06-10 at 6.46.37 PM.jpg
    Screen shot 2011-06-10 at 6.46.37 PM.jpg
    36.8 KB · Views: 729

BeerSmith

Staff member
Administrator
Grandmaster Brewer
Joined
Apr 5, 2003
Messages
5,889
Reaction score
67
Location
Virginia
When I researched this (some time ago) that was the recommended location for shared application data.  I will certainly look at changing it in the next build.

Brad
 

SleepySamSlim

Grandmaster Brewer
Joined
Dec 10, 2008
Messages
277
Reaction score
0
Location
North of Kalifornia
Brad

I think it depends what that file is for. I'm not a mac programmer (but I am slowly working on that) the main library is the right place for a file(s) that is a central resource for all users that is read only. Now if all the user accounts are all admin accounts the way you have it coded would work (though it may not be right). I was also surprised that in my non-admin account  $home/library/Application Support    I did not see a BeerSmith folder as that is where you would store any supporting files for BeerSmith.  Nor did I see a .plist file for BeerSmith in  $home/library/Preferences  -- a place to store all the user specific settings for BeerSmith.

Again - I'm not a mac expert but I do support both macs and PCs in a enterprise IT environment. Would be happy to act as a mac tester. My email is in my profile. This should a fairly easy bug to fix - but you also may need to re-map out where you store your global files and those files local to each user.

-Henry
 

Tim McManus

Apprentice
Joined
Jun 10, 2011
Messages
7
Reaction score
0
BeerSmith said:
When I researched this (some time ago) that was the recommended location for shared application data.  I will certainly look at changing it in the next build.

Brad

You are correct.  All you need the installer to do is authenticate as an administrator during installation and the error will not occur.
 

BeerSmith

Staff member
Administrator
Grandmaster Brewer
Joined
Apr 5, 2003
Messages
5,889
Reaction score
67
Location
Virginia
I'm going to change this to a local user directory in the next build - already put the code together yesterday and it should resolve this for anyone having the issue.

Brad
 
Top