• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rigistry

 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

i want to know is linux have registry.
Because i have an application in java. I want to write some data to registry from that application.
In windows its working fine i don't know is this will work with Linux or i need to modify the code to work in linux.

Please help me
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15441
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Linux systems generally do not have a registry in the same way that Windows has.

What information do you need to read or write? On Unix-like systems, applications usually write configuration files to the user's home directory, using a filename that starts with a . (dot), which makes the files hidden.
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i need to take care of Accidental deletion of that file but in windows its safe if it is in the Registry
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the Preferences API (in java.util.prefs). It saves application settings and the like in a way that's appropriate for the host OS (which on Windows is the Registry).
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
Check out the Preferences API (in java.util.prefs). It saves application settings and the like in a way that's appropriate for the host OS (which on Windows is the Registry).


Then if i run my application in linux it will take care of saving registry entry in Linux am i right
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will save the setting, yes. How it does it depends on the JVM implementation. The Registry in particular is a Windows-only thing.
[ July 18, 2008: Message edited by: Ulf Dittmer ]
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chiru Raj:
But i need to take care of Accidental deletion of that file but in windows its safe if it is in the Registry


Yes, and when the hard drive fails, you either have to restore the registry from a backup - which can fail if the new drive configuration doesn't match OR you have to recreate the entire registry from scratch, which means finding all the application install disks, re-installing each and every one of the apps, adding the app updates and service packs, and generally spending about a week just to get basic system functionality back. Oh wait, I'm showing my age. Nowadays you also have to make the reinstalled apps phone home and register with the software vendor.

Or to say it another way - in Linux, if you delete a file, you lose the file. In Windows, if you corrupt the registry, you've lost the entire registry!

The registry was a good idea, and it served a very useful purpose back when FAT sector sized were very large and config files were very small. However, things have changed a lot, and the downsides of the registry have become apparent. Not only do you put all your eggs in one basket - that basket has a proprietary binary format. Linux/Unix config files are normally text files. They can be backed up and restored using ordinary archive utilities and they can be scanned and/or modified in bulk using ordinary text utilities.

I do, in fact, back up my /etc directory tree on a daily basis using a cron-scheduled tar job.

Back in the Windows world, some developers have gotten fed up with registry headaches and gone back to ini files. The registry has one advantage over ini - which is that you can build a hierarchy instead of just a flat option tree, but these days so do XML config files.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic