• Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving a file to a relative path  RSS feed

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1084
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!