Q&A: a problem of programming with java?

Question by Sepehr: a problem of programming with java?
I have a folder that have the subfolders , so I want to write a programme that can go in subfolders and then return where I started, if you know programming with CSHELL it will like this one : while (……..)
{ …………
if ( -r aFolder )
{ cd aFolder “go in aFolder”
……………………..
cd .. “return in the folder where I started the programme”}
}
I want to write this programme with Java

Best answer:

Answer by Dr.Mr.Ed
The current directory can be found using:

String userDir = System.getProperty( “user.dir” );

And from there you can move down the hierarchy and know where you started from.

What do you think? Answer below!

You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.

Powered by Yahoo! Answers