Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Preferences on the Mac

 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried creating a preferences file using the code below, it works on Windows but not on Mac. Is there something else I need to do, or a different way to accomplish this?

 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the user executing the code doesn't have permission to write on the path used (the whole path) - then it is not possible.

OS X is based on Unix (or is Unix), therefore the right owner/group permissions are needed.
 
Rancher
Posts: 43024
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think there should be a permissions problem - a user should be able to access anything in her own userRoot, no?

Or do you mean the actual file "/Users/xyz/Library/Preferences/com.lipay.swreg.plist"? That would be screwed-up file permissions, though.
 
Rene Larsen
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:I don't think there should be a permissions problem - a user should be able to access anything in her own userRoot, no?

Or do you mean the actual file "/Users/xyz/Library/Preferences/com.lipay.swreg.plist"? That would be screwed-up file permissions, though.



I think it could be necessary to do a "Repair Disk Permissions" with "Disk Utility"??

I have just tested the code posted, and it works on my Mac.
 
Mike Lipay
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everyone, I found the problem.

Working between the two platforms I missed changing a \ to a / when I moved it to the Mac. After doing a couple different searches on this forum I finally hit one that covered System.getProperty("file.separator"), our class hasn't covered system properties yet, so I replaced \ everywhere with the file separator constant.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic