[Ironpython-users] Working Directory

Markus Schaber m.schaber at 3s-software.com
Fri Aug 26 10:14:26 CEST 2011


Hi, Paul,

Von: ironpython-users-bounces+m.schaber=3s-software.com at python.org
> On Fri, Aug 26, 2011 at 8:42 AM, Markus Schaber <m.schaber at 3s-
> software.com> wrote:
> > Von: ironpython-users-bounces+m.schaber=3s-software.com at python.org
> >> Is it possible to set the working directory at the command line?
> >> Google isn't helping me. What I want is:
> >>
> >> ipy.exe <working directory> mypy.py.
> >
> > Why don't you use the command line methods for changing the
directory?
> 
> That doesn't work so well for my build script. If something fails I
end up
> in the wrong directory.

Thats why I did use the brackets () in my example command:
(cd <workingdir> ; ipy.exe mypy.py)

They spawn a subshell, so after the closing bracket, the original
directory is restored.

I think, you can achive similar effects by saving the working directory
(e. G. in a variable), or using pushd/popd.


Best regards

Markus Schaber

___________________________
We software Automation.

3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 |
Fax +49-831-54031-50

Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com 
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects:
http://www.3s-software.com/index.shtml?sample_projects

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner |
Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 



More information about the Ironpython-users mailing list