Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > how to get the current path

Reply
Thread Tools

how to get the current path

 
 
Happy Day
Guest
Posts: n/a
 
      11-19-2006
Hi
I want to get the current working path. I used method
"System.getProperty("user.dir").", but it showed only part of full
path.
How can I find full path?

 
Reply With Quote
 
 
 
 
bablospresente@yahoo.com
Guest
Posts: n/a
 
      11-19-2006

Happy Day wrote:
> Hi
> I want to get the current working path. I used method
> "System.getProperty("user.dir").", but it showed only part of full
> path.
> How can I find full path?


it works fine on my wndows

ie. a.java

public class a{
public static String path(){
String p=System.getproperty("user.dir");
}
//call in main
println(pathdir());
}

outpur : C:\Documents and Settings\username\desktop

 
Reply With Quote
 
 
 
 
Lars Borup Jensen
Guest
Posts: n/a
 
      11-20-2006

Happy Day wrote:
> Hi
> I want to get the current working path. I used method
> "System.getProperty("user.dir").", but it showed only part of full
> path.
> How can I find full path?


Or you may want to use a File such as:

new File(System.getProperty("user.dir")).getAbsolutePa th()

Regards / Lars Borup Jensen
http://www.it-arbejde.dk

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to get Full Path of current directory ? (ASP.net) PHaroZ ASP .Net 5 08-17-2012 08:39 AM
How to get current folder path? Chung ASP .Net 2 01-20-2008 02:09 PM
How to get directory path of current rquest? Olav Tollefsen ASP .Net 1 10-29-2004 05:41 PM
Howto get the current file path with SSI Eranga Udesh ASP .Net 1 04-06-2004 05:18 AM



Advertisments