Dear Sir or Madam
by the following command I can open "envelopeX$i.out", which is saved beside the "main.tcl" in the same directory.
for {set i 1} {$i <= $nodeID} {incr i 1} {
if [catch {open envelopeX$i.out r} InFileID] {
puts "ERROR - cannot open envelopeX.out"
}
I also have a folder beside my program named "results", and I have saved the displacement outputs there named "disp.out"
how I can open a file (disp.out) which is in a folder (results) in the programs directory?
thanks
how I can open a file inside a folder
Moderators: silvia, selimgunay, Moderators
Re: how I can open a file inside a folder
To locate a file just specify the path to it. In your case you can use:
[open results/disp.out r]
usual rules for variable substitution exist so if you have a long path name or want to open different folders in a loop and such can use:
[open $path/disp r]
[open results/disp.out r]
usual rules for variable substitution exist so if you have a long path name or want to open different folders in a loop and such can use:
[open $path/disp r]