• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

directory

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic