Setting the current working directory

G

Guest

hey team,

i have quite a trivial problem, but damned if i can figure out the fix.

i have an application that reads and writes zip files. i need to set the
current working directory to the user's home directory, but can't seem to
find any way to do this. i had hoped it might be as simple as:


System.setProperty("user.dir", System.getProperty("user.home"));

but that doesn't work.

any ideas?

c
 
G

Gordon Beaton

i have an application that reads and writes zip files. i need to set
the current working directory to the user's home directory, but
can't seem to find any way to do this.

Yes, you can't change the working directory from Java.

On the other hand you really don't *need* to change the directory, you
can provide the pathname when you open the files you need to read and
write.

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top