Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes Saving a file to a relative path Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Saving a file to a relative path" Watch "Saving a file to a relative path" New topic
Author

Saving a file to a relative path

Naadir Peterson
Ranch Hand

Joined: Sep 22, 2004
Posts: 37
every day a log file has to be generated and is named according the date...

how do i save that file into a path eg. /dir/logs
it works wen i save it in.. for instance c:/dir/logs..
but i dont want the "c:" since the program could be loaded on any drive...
i created a method that creates a new file everyday and appends details to the file...

String file = date+".log"
appendLogFile("/direcory/" + file);

thanx
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1076

better idea would be , make an environment file either xml or else and keep path in same file or
if you are doing any database operation you can keep path in database


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Saving a file to a relative path
 
Similar Threads
JBoss performance Tuning in Linux
Script Help
Tomcat crashes
Strange Error messgae in tomcat server
[log4j] DailyRollingFileAppender