Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hoe can I create folders in any directory specified by me??

 
Amit Roy
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi frns
Using the file method i can create folders in the directory in whch my class file is placed is there a way in which i can create directories in the path specified by me Eg if i am in D:\ drive and want to create a folder in c:\amit\roy\
Amit Roy
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amit,
The File class has a constructor which takes both parent, and child as args.
Example :
public File(String parent, String child)
File f = new File("d:\\amit","test.txt");
f.createNewFile() will create a test.txt file in d:\amit dir I think. Please give it a try!
regds
maha anna
From Java Doc
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic