Working directory

52 views
Skip to first unread message

Marc Vandenbosch

unread,
Jan 29, 2013, 12:55:04 PM1/29/13
to ooo-...@googlegroups.com
Hi,

Is there a possibility to set the application working directory in getdown.txt ?
Setting user.dir doesn't seem to change anything.

Regards,

Marc

Michael Bayne

unread,
Jan 29, 2013, 1:10:48 PM1/29/13
to ooo-...@googlegroups.com

On Tue, Jan 29, 2013 at 9:55 AM, Marc Vandenbosch <marc.van...@gmail.com> wrote:
Is there a possibility to set the application working directory in getdown.txt ?
Setting user.dir doesn't seem to change anything.

The working directory for the launched app is always the directory that contains the getdown.txt file.

There's no particular reason for this other than that it is a sensible default. Getdown could be modified to allow the working directory of the launched application to be configured via a system property or in getdown.txt. However, there's no especially good way to do this in a cross-platform compatible manner. How would you specify a directory that works for both Mac, Linux and WIndows?

I guess if it was specified in a system property passed into Getdown when it was launched, the per-platform Getdown launchers could pass in a platform-appropriate directory. Something like:

java -jar getdown.jar -Dlaunchdir=somedirectory appdir

That said, if you did not use the appdir as the current directory for the app, it would be more complex to find and access any resources included with the app. I suppose not all apps use resources directly from the file system.

Marc Vandenbosch

unread,
Jan 30, 2013, 3:24:19 AM1/30/13
to ooo-...@googlegroups.com
Thanks for your answer.
Unfortunately it seems that the working directory is the one that issued the java command.

I followed the quick start and thus created a base directory containing a '.bat' file with the java command to start the client.
Then I have a subdirectory containing both the getdown client jar and the getdown.txt.

%appdir% is correctly defined(subdir) but it doesn't change the working directory of the application.

Am I doing something wrong?

Reply all
Reply to author
Forward
0 new messages