From: <no...@tc...> - 2025-10-06 19:48:50
|
Automated mail by fx, on behalf of no...@tc... Ticket Change [e69857d79cf44bff9d1c7a77da57afbf4b564afb8f3e2ed1c448fd7b019f999c] [Add progress bar to the tar package] By anonymous For Tcllib On 2025-10-06T19:42:53.500 Details https://core.tcl-lang.org/tcllib/tinfo?name=e69857d79cf44bff9d1c7a77da57afbf4b564afb8f3e2ed1c448fd7b019f999c Ticket https://core.tcl-lang.org/tcllib/tktview/3438f804e41b67d469fd364087457d4c718d4f5b Changed Fields assignee: nobody closer: nobody comment: The code below is a minor adaption of the tar::create procedure. It adds the option -progress <name of callback function> that will update a progress bar. proc ::tar::create {tar files args} { set dereference 0 set chan 0 set gzip 0 set progress "" parseOpts {dereference 0 chan 0 gzip 0 progress 1} $args lassign [SetupCreation $chan $gzip $tar] fh pos set files [recurseDirs $files $dereference] if {$progress!=""} { set count [llength $files] eval [concat $progress $count 0] set i 0 } foreach x $files { writefile $x $fh $dereference $x if {$gzip} { chan configure $fh -flush sync } if {$progress!=""} { incr i eval [concat $progress $count $i] } } if {$progress!=""} { eval [concat $progress 0 0] } puts -nonewline $fh [string repeat \\x00 1024] Close $fh $pos $chan $gzip return $tar } foundin: 0.15 is_private: 0 login: anonymous priority: 5 Medium resolution: None severity: Important status: Open submitter: anonymous subsystem: tar title: Add progress bar to the tar package type: RFE ------------------------------------------------------------ See Tcl/Tk development @ http://core.tcl-lang.org/ ------------------------------------------------------------ |