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
Post a Comment