From: Stefan F. <ste...@we...> - 2012-02-22 17:34:58
|
Bill & Jerry, thanks for your input. My proposed solution is the following: Depending on the OS detected (using system property os.name) configuration files will be stored to the following folders: A) Unix-Systems (except Mac): ~/.rails (with ~ equals content of system property user.home) B) Mac OS-Systems: ~/Library/Preferences/net.sourceforge.rails (again with ~ equals system property user.home) C) Windows-System: First it tries to locate the common application data folder (something like C:\\Documents and Settings\\username\\Application Data). There it uses the subfolder rails. This is done using the Java Library WinFolderPath (http://code.google.com/p/winfolderpath/) If this fails the user directory is found using System.getEnv("USERPROFILE"), as user.home has a known unfixed bug on Windows system (see http://bugs.sun.com/view_bug.do?bug_id=4787931) Questions: * I do no know which name I should use for the rails subfolder for the Windows case (either user or application data folder)? Should I use 'rails' or '.rails' (as for Unix) or 'net.sourceforge.rails' (as for Mac OS)? * Is there still a need for an option to provide a command line overwrite? Stefan On 02/22/2012 07:03 AM, Bill Rosgen wrote: > > On 2012-02-22, at 1:07 , Stefan Frey wrote: >> What would you think about adding a default directory to store rails >> application data and settings. Something like ~/.rails on a Unix system. >> The major advantage would be that the settings would survive new >> releases without providing an installer that searches for the >> application data. > > ... > >> Another question is how does this work on a Mac system? As the Mac OS is >> built on a BSD I would assume that the Unix way of things should work, >> but is that true? > > In order to be difficult, Mac OS provides at least three places to store this data. The defaults are: > > ~/Library/Preferences/org.rails.rails for 'preferences', like the size and position of windows. > ~/Library/Rails for 'irreplacable' user data: I am not sure that Rails has any such data > ~/Library/Application Support/Rails for 'nonessential' user data like templates, plugins, etc. > > In practice, most apps store small preference files in ~/Library/Preferences and larger pieces of data in ~/Library/Application Support. Finding the user's home directory can be done with System.getProperty("user.home"), or at least this is what the docs say, and it seems to be appropriate to hardcode the rest of the chosen path. > > All of this information comes from https://developer.apple.com/library/mac/#qa/qa1170/_index.html . > > Many mac programs do just follow the Unix way and throw things into, for example, ~/.rails , but this behaviour is somewhat inappropriate and can confuse users who are not happy with the command line, which is pretty much the only way to access these directories. Programs that do things like this are usually things like ssh, git, and emacs, which can usually assume that their users are somewhat sophisticated. > > Bill > > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |