aspose file tools*
The moose likes Java in General and the fly likes directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "directory" Watch "directory" New topic
Author

directory

Neel Chow
Ranch Hand

Joined: Jan 10, 2005
Posts: 55
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

Joined: Apr 28, 2004
Posts: 131

>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 ]

Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: directory