Message: Current working directory Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Current working directory 

Forum: (Graphical) User Interfaces
Date: 06 May, 2015
From: Mojca Miklavec <Mojca Miklavec>

I created a standalone Geant4 app with Qt interface and added an "open macro file" icon. This works well, but when a macro file wants to load another file, that doesn't work, most likely because the current working directory isn't set properly.

(It works if I start the app from the command line in the right dir, but it doesn't work if I start the app by double-clicking on an app icon in launchpad in Mac OS X.)

I found an ugly temporary workaround to use /control/macroPath <dir>, but I would like to be able to at least query "pwd" to check where I am or to "cd" into a different folder, but I wasn't able to figure out how to do any of that. "pwd" always shows "/" and "cd" doesn't want to go anywhere.

(At the end it will probably be extremely helpful to also change the source code, so that current working directory will be changed whenever a macro file is loaded via GUI. But it would help to at least start with some basics first.)

Any hints about how to check and change the current working directory highly appreciated.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Current working directory   (John Allison - 09 May, 2015)
(_ None: Re: Current working directory   (garnier - 22 Jun, 2015)
(_ Feedback: Re: Current working directory   (Mojca Miklavec - 23 Jun, 2015)
 Add Message Add Message
to: "Current working directory"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]