Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

directory

 
Neel Chow
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am writing a program for testing some thing in a database.
The user enters the directory where he wants to store the output in the console and the program creates the directory.

now I want to store the result files from the program in that directory.
>if I dont do anything the program stores the files in the folder where my program is residing.
>I can concatenate the full path to the file name and store it(i dont like this idea.)
>is there any way in java so that i can change directory (make the user defined directory as the current directory) and store the files??

the problem may be too simple but trust me i really need help.

Thanks
 
Petr Blahos
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

>I can concatenate the full path to the file name and store it(i dont like this idea.)


This is the best you can do. It is actually a good idea because
it is correct. Java does not know anything about current working
directory. Your request to open a "filename" is just passed to
the OS and it will do whatever it can.


the problem may be too simple but trust me i really need help.


If you yourself percieve that this problem may be too simple,
it should stop you from posting it in advanced forum.

P.
[ February 18, 2005: Message edited by: Petr Blahos ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic