Tcl Library Source Code

View Ticket
Login
Ticket UUID: c976e4a85dae89919f4414bbfb1eec7acba7bf37
Title: zipfile::decode::unzip bug with some zips in ::close [::open $dst w] ; # touch
Type: Bug Version: 0.10.1
Submitter: anonymous Created on: 2024-10-16 15:56:51
Subsystem: zip Assigned To: nobody
Priority: 5 Medium Severity: Critical
Status: Open Last Modified: 2024-10-16 15:56:51
Resolution: None Closed By: nobody
    Closed on:
Description:
with some zip file raise this stack trace of the error

couldn't open "C:/temp/_g/kratos.gid/apps/Common": permission denied
    while executing
"::open $dst w"
    (procedure "CopyFile" line 16)
    invoked from within
"CopyFile $src fd [file join $dst $src]"
    (procedure "zipfile::decode::unzip" line 7)
    invoked from within
"zipfile::decode::unzip $zd $out"
    (procedure "zipfile::decode::unzipfile" line 4)
    invoked from within
"zipfile::decode::unzipfile $zipfile $extraction_dir"
    (procedure "::gid_unzip" line 3)
    invoked from within
"::gid_unzip $zipfile $extraction_dir"

It is in the line 
::close [::open $dst w] ; # touch

The folder has been created and has subfolders when raise the error 
with a simple catch it works well

        if { [catch {set out [::open $dst w]} msg] } {
            # set to_stop_in_debug 1
        } else {
            ::close $out
        }