Results 1 to 4 of 4
I want to write a file in linux
for windows I use
FileWriter airFile = new FileWriter("c:\Asthma_Data\zip.xml");
what path would I use for linux?
should I start from root
e.g
...
- 06-22-2011 #1Just Joined!
- Join Date
- Jun 2011
- Posts
- 19
Write to a file
I want to write a file in linux
for windows I use
FileWriter airFile = new FileWriter("c:\\Asthma_Data\\zip.xml");
what path would I use for linux?
should I start from root
e.g
FileWriter airFile = new FileWriter("root\\Asthma_Data\\zip.xml");
- 06-22-2011 #2Just Joined!
- Join Date
- Jun 2011
- Posts
- 3
If your Asthma_Data folder is present inside opt then
FileWriter airFile = new FileWriter("/opt/Asthma_Data/zip.xml");
- 06-22-2011 #3Just Joined!
- Join Date
- Jun 2011
- Posts
- 19
what about root????
shouldnt it be
FileWriter airFile = new FileWriter("/opt/Asthma_Data/zip.xml");
- 06-22-2011 #4
It is good practice to avoid using the root user, if possible.
In general:
If that Asthma_Data/zip.xml is your personal data, it belongs in your home directory.
If data needs to be shared locally or remote, then I tend to create datadirectories like /data1, /data2, etc and bindmount directories in them to /dataYou must always face the curtain with a bow.


Reply With Quote