• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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 ]
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic