Changing directories

Hello all!

I am trying to convert a root application from windows (XP) to linux (openSUSE 11.1 with root 5.22/00). It only provides some extra objects and functions. On windows when I start up root (actually I start the root extended application), I can type:
.cd d:\whichever_directory
and from there I can execute my macros by:
.x mymacro.cpp

On linux, however, it won’t change the directories, and it’s always looking for macros at $ROOTSYS/macros. What I mean is, when I type
.cd /home/gergo/mydata
and from there
.x analysis.cppp

It’s complainig that
Error in TApplication::ExecuteFile: macro analysis.cpp not found in path .:/home/gergo/root/macros:

I understand that for some reason it doesn’t want to change the current directory. Is this only available in the windows version? I was looking at the CINT raw command list, and couldn’t find the .cd command. Does it mean it shouldn’t work, and only by chance it’s working under windows?

A huge part of this application relies on this feature of .cd and I really wouldn’t like to “hard code” the folder names, or to work with global variables. The command .ls not returning any files at all, on both systems.

regards,
Soti

p.s. I did not write the original application

Hi,

Try:gSystem->cd("/home/gergo/mydata");

Cheers,
Philippe.

1 Like

[quote=“pcanal”]Hi,

Try:gSystem->cd("/home/gergo/mydata");

Cheers,
Philippe.[/quote]

Thanks, it’s working. Though the initial question remains…

regards,
Soti