Tcl + Check file existance -


i'm trying check if file exists or not in tcl, can't seem true result. though know present.

while {true} {      if { [file exists $file_name] == 1} {                        exp_send "copy file.txt destination \r"         puts " file copied!"     }      puts "file not copied"      } 

i execute file not copied line. did put [file exists $file_name] , end 0. know fact file exists in current directory. suggestions?

edit:

an alternative method i'm trying pursue, when dir using tcl script. output of files in directory. need match file list outputted , satisfy if when match found ...

i'm executing script location a, using script telnet location b. when file exists, checks location itself. problem ... since need searching in location b ...

the file exists command works local filesystems. if want check whether remote system has file, you'll have exp_send instructions check you. unfortunately, can't quite tell you're talking description, can't advise how it.

and want break after puts "file copied" line otherwise go round loop again. don't want that!


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -