• Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving a file to a relative path  RSS feed

 
Naadir Peterson
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
 
Shailesh Chandra
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!