469,270 Members | 1,014 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

How to get path to current directory?

Hello.

How to get path to current directory and put this path to object of class
String?
I found FileSystemView.getHomeDirectory() but it returns path to home
directory for example:

C:\Documments and Settings\Thomas

Thanks for help.
Jul 17 '05 #1
1 87397
Tomek wrote:
Hello.

How to get path to current directory and put this path to object of class
String?
I found FileSystemView.getHomeDirectory() but it returns path to home
directory for example:

C:\Documments and Settings\Thomas


Posting your query once really was sufficient.

To answer your question, try grabbing the "user.dir" property -- this
is the current working directory. To retreive this property, use
something akin to:

String userDir = System.getProperty("user.dir");

HTH!

Brad BARCLAY

--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org


Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Kali K E | last post: by
3 posts views Thread by Stephen Ferg | last post: by
34 posts views Thread by Reinhold Birkenfeld | last post: by
6 posts views Thread by Laszlo Zsolt Nagy | last post: by
11 posts views Thread by kk | last post: by
3 posts views Thread by David Thielen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.