wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes getting the File from Current directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "getting the File from Current directory" Watch "getting the File from Current directory" New topic
Author

getting the File from Current directory

Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 289

Hi
i have a file in folder called /util/xx.txt

my code is running in /run/runing.java

how can i get the file xx.txt from my code
[ June 08, 2008: Message edited by: Chiru Raj ]

-Chiru
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42355
    
  64
By using an absolute path: new File("/util/xx.txt")


Ping & DNS - my free Android networking tools app
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: getting the File from Current directory