how to copy linked file thru tcl -


i want copy file thru tcl proggraming , these files linked. code:

if { [file type $sfile] == "link" } {         set fget [file readlink $sfile ]          }               file copy -force $fget $dir 

it works if $sfile link. not work if source file of link link.

how can recursively trace symbolic links?

recursive.

while {[file type $sfile] eq "link"]} {     set newfile [file readlink $sfile]     if {[string index $newfile 0] ne "/"} {         set newfile [file dirname $sfile]/$newfile     }     set sfile $newfile } file copy -force $sfile $dir 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -