Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/sqlite/blob/master/tool/cp.tcl # sqlite [Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `sqlite / tool / cp.tcl` 28 lines ยท 783 bytes Raw Blame History 1 #/usr/bin/tclsh 2 # 3 # This is a TCL script that copies multiple files into a common directory. 4 # The "cp" command will do this on unix, but no such command is available 5 # by default on Windows, so we have to use this script. 6 # 7 # tclsh cp.tcl FILE1 FILE2 ... FILEN DIR 8 # 9 10 # This should be as simple as 11 # 12 # file copy -force -- {*}$argv 13 # 14 # But jimtcl doesn't support that. So we have to do it the hard way. 15 16 if {[llength $argv]<2} { 17 error "Usage: $argv0 SRC... DESTDIR" 18 } 19 set n [llength $argv] 20 set destdir [lindex $argv [expr {$n-1}]] 21 if {![file isdir $destdir]} { 22 error "$argv0: not a directory: \"$destdir\"" 23 } 24 for {set i 0} {$i<$n-1} {incr i} { 25 set fn [file normalize [lindex $argv $i]] 26 set tail [file tail $fn] 27 file copy -force $fn [file normalize $destdir/$tail] 28 }