Tcl + Check file existence
问题 I'm trying to check if a file exists or not in Tcl, but I can't seem to get a true result. Even though I know it is present. while {true} { if { [file exists $file_name] == 1} { exp_send "copy file.txt destination \r" puts " File copied!" } puts "File Not copied" } I always execute the File not copied line. I did a put for [file exists $file_name] and I always end up with 0. But I know for a fact that the file exists in the current directory. Any suggestions? EDIT: An alternative method that