Idle Musings: Correct value of "user.dir"

Ranjit Mathew rmathew4lists@hotmail.com
Wed Feb 26 05:27:00 GMT 2003


Hi,

    The "user.dir" system property is used to indicate "User's current
working directory" according to the Sun JDK 1.4.1 docs - however, is
it the working directory *at the time of process creation* or *at the
time of lookup*?

Apparently it's the *former* - I wrote a simple test program in Java 
with a JNI helper method to change the directory and tested it with 
Sun's JDK 1.4.1 on Win2K.

So it looks like we are safe here.

Imagine the kludges needed in the code trying to implement this 
if it were the *latter*!

Ranjit.

--
Ranjit Mathew               Email: rmathew AT hotmail DOT com

Bangalore, INDIA.           Web: http://ranjitmathew.tripod.com/



More information about the Java mailing list