involuntary change of the current directory

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
aaataha
Posts: 15
Joined: Sun Oct 13, 2019 1:44 pm

involuntary change of the current directory

Post by aaataha »

Hi,

i am trying to run three files [model.tcl, Gravity.tcl, PushX.tcl] from inside another file using the "source" command:

wipe;
puts [pwd];
source model.tcl;
puts [pwd];
source Gravity.tcl;
source PushX.tcl;

All files are in the same folder. However, when i try running the script, the current directory is changed while executing the first file (model.tcl) and I find my outputs in this other directory and then the second command (source Gravity.tcl;) can't be executed because the current directory is no longer the one where the three files are located. I used the commend "puts [pwd]" to show me the current directory and it can be seen from the results that it has changed after executing the "source model.tcl;" command .. [the results of the pwd commands are put between *** to highlight them]

*** H:/10-story three-bay building/pushover ***
Section UC With Tag 11 Has Been Generated
Section UC With Tag 12 Has Been Generated
Section UC With Tag 13 Has Been Generated
Section UC With Tag 14 Has Been Generated
Section UC With Tag 15 Has Been Generated
Section UC With Tag 21 Has Been Generated
Section UC With Tag 22 Has Been Generated
Section UC With Tag 23 Has Been Generated
End of Define Sections
End of Define Model Elements
*** C:/Users/Abdelrahman Taha ***
couldn't read file "Gravity.tcl": no such file or directory
while executing
"source Gravity.tcl"
(file "RunPushover.tcl" line 7)
<<< Process finished (PID=9944). (Exit code 0)
================ READY ================


why would that happen and how to fix it?

Thanks
Post Reply