Author Topic: Mac OS X - BS tries to create its subdirectory in system tree and fails  (Read 6174 times)

Offline zgoda

  • BeerSmith Apprentice Brewer
  • **
  • Posts: 16
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)

Offline BeerSmith

  • Brewer, Author, Patriot
  • BeerSmith Administrator
  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 5371
  • BeerSmith - take the guesswork out of brewing!
    • BeerSmith
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
Get a free trial of BeerSmith 3 here

Offline zgoda

  • BeerSmith Apprentice Brewer
  • **
  • Posts: 16
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.

Offline clasley

  • BeerSmith New Brewer
  • *
  • Posts: 1
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

Offline SleepySamSlim

  • Barley Engineer
  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 277
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.
« Last Edit: June 10, 2011, 08:10:04 PM by SleepySamSlim »
Some people tell you the old walkin' blues ain't bad
Worst old feelin' that I've ever had ...
-Robert Johnson

Offline BeerSmith

  • Brewer, Author, Patriot
  • BeerSmith Administrator
  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 5371
  • BeerSmith - take the guesswork out of brewing!
    • BeerSmith
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
Get a free trial of BeerSmith 3 here

Offline SleepySamSlim

  • Barley Engineer
  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 277
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
Some people tell you the old walkin' blues ain't bad
Worst old feelin' that I've ever had ...
-Robert Johnson

Offline Tim McManus

  • BeerSmith Apprentice Brewer
  • **
  • Posts: 7
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.

Offline BeerSmith

  • Brewer, Author, Patriot
  • BeerSmith Administrator
  • BeerSmith Grandmaster Brewer
  • *****
  • Posts: 5371
  • BeerSmith - take the guesswork out of brewing!
    • BeerSmith
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
Get a free trial of BeerSmith 3 here