在TCL 8.4中复制多个文件

时间:2018-07-19 16:00:24

标签: tcl tk

我看到了这个问题的多个答案,但没有一个是针对TCL 8.4或更早版本的。

所以这是我尝试但无法使用的代码:

set files [ glob home/*.tcl] 
file copy {*}$files dest/

如注释之一所示,使用eval对复制问题进行了排序。 移动文件应通过以下方式完成:

eval file rename -force $flist dest/

1 个答案:

答案 0 :(得分:1)

请参考How to copy or move multiple files with same extension?中的8.5+解决方案:8.5之前没有扩展运算符。

该示例将变为:

pip install "path to the downloaded whl file"

也就是说,如果可能,您应该升级到8.5+(出于多种原因),但是建议在这种扩展方案中避免使用set files [glob home/*.tcl] eval file copy $files dest/ 。或者,您可能希望通过显式遍历$ files进行扩展,但这也有性能下降。