| Author |
Not able to create directory
|
Kaustubh G Sharma
Ranch Hand
Joined: May 13, 2010
Posts: 1145
|
|
I am trying to create a direcorty from the code below
but not able to generate directory from this .....result-> file not found exception.... please help me out
Thanks
Kaustubh
|
No Kaustubh No Fun, Know Kaustubh Know Fun..
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2925
|
|
You can use pathSeparator field from the File class for adding path separator.
Can you provide the stack trace?
|
Mohamed Sanaulla | My Blog
|
 |
Kaustubh G Sharma
Ranch Hand
Joined: May 13, 2010
Posts: 1145
|
|
done it but still not creating it my update code is shown below
or
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
File.html#mkdir() Returns: true if and only if the directory was created; false otherwise
So you should check the result of that method.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2925
|
|
|
So you want to create a directory and then a file within that? And you are using mkdir()?
|
 |
Kaustubh G Sharma
Ranch Hand
Joined: May 13, 2010
Posts: 1145
|
|
yeeppyyyy
I tried the code below and it is working fine ....I think it is not permitting me to create more than one directory at a time ..
check this out...
|
 |
Kaustubh G Sharma
Ranch Hand
Joined: May 13, 2010
Posts: 1145
|
|
my job is to create a directory within a directory and when I have the file name than want to put that file under it.. hope you got it right...thanks for your kind help
Kaustubh
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8430
|
|
Kaustubh G Sharma wrote:...I think it is not permitting me to create more than one directory at a time  ..
File#mkdirs()
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
Mohamed Sanaulla
Bartender
Joined: Sep 08, 2007
Posts: 2925
|
|
Maneesh Godbole wrote:File#mkdirs()
This is really useful info. Without reading about the method- I had assumed that it would create multiple directories in the same location. Thanks Maneesh!!
|
 |
Kaustubh G Sharma
Ranch Hand
Joined: May 13, 2010
Posts: 1145
|
|
Thanks All
|
 |
 |
|
|
subject: Not able to create directory
|
|
|