I have porting issues (moving from Tcl 8 to 9) with creating and reading
tar archives.
Creating, -progress option has been removed in the last tar version.
I used to do this:
set fd [open $zipfile wb]
fconfigure $fd -translation binary
::zlib push gzip $fd -level 9
# tar::create $fd $paths -chan -progress [list ::UIProgressBar {}]
tar::create $fd $paths -chan
close $fd
Reading:
set f [open $zipfile rb]
::zlib push gunzip $f
set result [tar::stat $f "" -chan]
close $f
1: {::bgerrorhandler {error during seek on "filea58d4ac0": invalid
argument} {-code 1 -level 0 -errorstack {INNER {invokeStk1 seek
filea58d4ac0 0} CALL {IsGzFile filea58d4ac0} CALL {SetupReading 1 0 filea58d4ac0} CALL {tar::stat filea58d4ac0 {} -chan} CALL {::meshparts::AssemblyArchiveGetData C:/arbeit/MESHPARTS-Offline/ Assemblies/Schulung/ProfileScrews2/ProfileScrews.mpasmz} CALL {::meshparts::DirectorySyncAnalyse C:/arbeit/MESHPARTS-Offline/ Assemblies/Schulung/ProfileScrews2/ProfileScrews.mpasmz {} 0 0}
CALL ::meshparts::ExplorerSyncAnalyse
CALL ::meshparts::ExplorerArchiveUnpack} -errorcode {POSIX EINVAL
{invalid argument}} -errorinfo {error during seek on "filea58d4ac0":
invalid argument
while executing
"seek $fh 0"
(procedure "IsGzFile" line 3)
invoked from within
"IsGzFile $fh"
(procedure "SetupReading" line 16)
invoked from within
"SetupReading $chan $gzip $tar"
(procedure "tar::stat" line 5)
invoked from within
"tar::stat $f "" -chan"
Any ideas on this?
Am 03.09.2025 um 15:13 schrieb meshparts:
I have porting issues (moving from Tcl 8 to 9) with creating and reading tar archives.
Creating, -progress option has been removed in the last tar version.
I used to do this:
set fd [open $zipfile wb]
fconfigure $fd -translation binary
::zlib push gzip $fd -level 9
# tar::create $fd $paths -chan -progress [list ::UIProgressBar {}]
tar::create $fd $paths -chan
close $fd
Reading:
set f [open $zipfile rb]
::zlib push gunzip $f
set result [tar::stat $f "" -chan]
close $f
1: {::bgerrorhandler {error during seek on "filea58d4ac0": invalid argument} {-code 1 -level 0 -errorstack {INNER {invokeStk1 seek filea58d4ac0 0} CALL {IsGzFile filea58d4ac0} CALL {SetupReading 1 0 filea58d4ac0} CALL {tar::stat filea58d4ac0 {} -chan} CALL {::meshparts::AssemblyArchiveGetData C:/arbeit/MESHPARTS-Offline/ Assemblies/Schulung/ProfileScrews2/ProfileScrews.mpasmz} CALL {::meshparts::DirectorySyncAnalyse C:/arbeit/MESHPARTS-Offline/ Assemblies/Schulung/ProfileScrews2/ProfileScrews.mpasmz {} 0 0} CALL ::meshparts::ExplorerSyncAnalyse CALL ::meshparts::ExplorerArchiveUnpack} -errorcode {POSIX EINVAL {invalid argument}} -errorinfo {error during seek on "filea58d4ac0": invalid argument
while executing
"seek $fh 0"
(procedure "IsGzFile" line 3)
invoked from within
"IsGzFile $fh"
(procedure "SetupReading" line 16)
invoked from within
"SetupReading $chan $gzip $tar"
(procedure "tar::stat" line 5)
invoked from within
"tar::stat $f "" -chan"
Any ideas on this?
I did some further testing with this simple code, which works with Tcl 8 and tar 0.11 but fails with Tcl 9.0.2 and tar 0.13:
package require tar
set f [open $zipfile rb]
::zlib push gunzip $f
set result [tar::stat $f "" -chan]
close $f
The error is:
error during seek on "file4ed5dd0": invalid argument
while executing
"seek $fh 0"
(procedure "IsGzFile" line 3)
invoked from within
"IsGzFile $fh"
(procedure "SetupReading" line 16)
invoked from within
"SetupReading $chan $gzip $tar"
(procedure "tar::stat" line 5)
invoked from within
"tar::stat $f "" -chan"
Any ideas?
…
I did some further testing with this simple code, which works with Tcl 8
and tar 0.11 but fails with Tcl 9.0.2 and tar 0.13:
package require tar
set f [open $zipfile rb]
::zlib push gunzip $f
set result [tar::stat $f "" -chan]
close $f
The error is:
error during seek on "file4ed5dd0": invalid argument
while executing
"seek $fh 0"
(procedure "IsGzFile" line 3)
invoked from within
"IsGzFile $fh"
(procedure "SetupReading" line 16)
invoked from within
"SetupReading $chan $gzip $tar"
(procedure "tar::stat" line 5)
invoked from within
"tar::stat $f "" -chan"
Any ideas?
Am 05.09.2025 um 21:41 schrieb meshparts:
Am 03.09.2025 um 15:13 schrieb meshparts:
I have porting issues (moving from Tcl 8 to 9) with creating and
reading tar archives.
Creating, -progress option has been removed in the last tar version.
I used to do this:
set fd [open $zipfile wb]
fconfigure $fd -translation binary
::zlib push gzip $fd -level 9
# tar::create $fd $paths -chan -progress [list ::UIProgressBar {}]
tar::create $fd $paths -chan
close $fd
Reading:
set f [open $zipfile rb]
::zlib push gunzip $f
set result [tar::stat $f "" -chan]
close $f
1: {::bgerrorhandler {error during seek on "filea58d4ac0": invalid
argument} {-code 1 -level 0 -errorstack {INNER {invokeStk1 seek
filea58d4ac0 0} CALL {IsGzFile filea58d4ac0} CALL {SetupReading 1 0
filea58d4ac0} CALL {tar::stat filea58d4ac0 {} -chan} CALL
{::meshparts::AssemblyArchiveGetData C:/arbeit/MESHPARTS-Offline/
Assemblies/Schulung/ProfileScrews2/ProfileScrews.mpasmz} CALL
{::meshparts::DirectorySyncAnalyse C:/arbeit/MESHPARTS-Offline/
Assemblies/Schulung/ProfileScrews2/ProfileScrews.mpasmz {} 0 0}
CALL ::meshparts::ExplorerSyncAnalyse
CALL ::meshparts::ExplorerArchiveUnpack} -errorcode {POSIX EINVAL
{invalid argument}} -errorinfo {error during seek on "filea58d4ac0":
invalid argument
while executing
"seek $fh 0"
(procedure "IsGzFile" line 3)
invoked from within
"IsGzFile $fh"
(procedure "SetupReading" line 16)
invoked from within
"SetupReading $chan $gzip $tar"
(procedure "tar::stat" line 5)
invoked from within
"tar::stat $f "" -chan"
Any ideas on this?
I did some further testing with this simple code, which works with Tcl
8 and tar 0.11 but fails with Tcl 9.0.2 and tar 0.13:
package require tar
set f [open $zipfile rb]
::zlib push gunzip $f
set result [tar::stat $f "" -chan]
close $f
The error is:
error during seek on "file4ed5dd0": invalid argument
while executing
"seek $fh 0"
(procedure "IsGzFile" line 3)
invoked from within
"IsGzFile $fh"
(procedure "SetupReading" line 16)
invoked from within
"SetupReading $chan $gzip $tar"
(procedure "tar::stat" line 5)
invoked from within
"tar::stat $f "" -chan"
Any ideas?
This is not a problem with Tcl 8 or 9, but due to changes from tar 0.11
to 0.13.
If removing the line "::zlib push gunzip $f", everything works fine for me.
Paul
On 9/5/25 21:41, meshparts wrote:
…
I did some further testing with this simple code, which works with Tcl
8 and tar 0.11 but fails with Tcl 9.0.2 and tar 0.13:
package require tar
set f [open $zipfile rb]
::zlib push gunzip $f
set result [tar::stat $f "" -chan]
close $f
The error is:
error during seek on "file4ed5dd0": invalid argument
while executing
"seek $fh 0"
(procedure "IsGzFile" line 3)
invoked from within
"IsGzFile $fh"
(procedure "SetupReading" line 16)
invoked from within
"SetupReading $chan $gzip $tar"
(procedure "tar::stat" line 5)
invoked from within
"tar::stat $f "" -chan"
Any ideas?
Either omit the "zlib push…" and use the new "-gzip" option after
"-chan", or use the patch in the tcllib ticket
https://core.tcl-lang.org/tcllib/tktview/ cc1e1bc658955776b14b604ec9e11a863375ef6a
which might overcome this issue.
This is the patch
https://core.tcl-lang.org/tcllib/artifact/60c43fe93d939832
Best regards,
Christian
…
I'll take a look at the patch.
On 9/6/25 08:39, meshparts wrote:
…
I'll take a look at the patch.
Octal is the hidden octopus in the room (in format).
Use at least version 0.14 from the tcllib repo.
But please try my patch with your original zlib logic
around tar::stat anyway.
Best regards,
Christian
…
The last version I could find is 0.13: https://github.com/tcltk/tcllib/blob/master/modules/tar/tar.tcl
Where do I get 0.14?
On 9/6/25 22:25, meshparts wrote:
… The last version I could find is 0.13: https://github.com/tcltk/
tcllib/blob/master/modules/tar/tar.tcl
Where do I get 0.14?
The canonical source of tcllib is not on github but in a fossil
repository below https://core.tcl-lang.org, see
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/index.md
So on github you find a more or (in your case) less synchronized
copy of it.
Better for you, Luke, if you search the real, true force,
Christian
Am 07.09.2025 um 01:06 schrieb undroidwish:
On 9/6/25 22:25, meshparts wrote:
… The last version I could find is 0.13: https://github.com/tcltk/
tcllib/blob/master/modules/tar/tar.tcl
Where do I get 0.14?
The canonical source of tcllib is not on github but in a fossil
repository below https://core.tcl-lang.org, see
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/index.md
So on github you find a more or (in your case) less synchronized
copy of it.
Better for you, Luke, if you search the real, true force,
Christian
The force got me there already.
I downloaded the tcllib release 2.0 but that contains only tar 0.13.
Now I tried to download the latest snapshot (https://core.tcl-lang.org/ tcllib/wiki?name=Downloads) and the webpage seems to have a technical
issue: It loops endlessly around that "checking you are not a robot..." thing.
Is there another way?
…
BUT! The tar version is still 0.13...
On 9/7/25 09:03, meshparts wrote:Thank you for the direct link.
…
BUT! The tar version is still 0.13...
Right are you, Luke. The 0.14 version is in an unreleased branch.
So take pkgIndex.tcl from
https://androwish.org/home/raw/91ff376148d2eb8e791936fe6c925d03a5d6bc79? at=91ff376148d2eb8e
and tar.tcl from
https://androwish.org/home/raw/c4c5e925e09b3cae3f54ed18da4cc510ea9f36f8? at=c4c5e925e09b3cae
with my proposed seek fix applied. This would hopefully be 0.15 someday.
Best regards,
Christian
On 9/7/25 09:03, meshparts wrote:Hi Christian,
…
BUT! The tar version is still 0.13...
Right are you, Luke. The 0.14 version is in an unreleased branch.
So take pkgIndex.tcl from
https://androwish.org/home/raw/91ff376148d2eb8e791936fe6c925d03a5d6bc79? at=91ff376148d2eb8e
and tar.tcl from
https://androwish.org/home/raw/c4c5e925e09b3cae3f54ed18da4cc510ea9f36f8? at=c4c5e925e09b3cae
with my proposed seek fix applied. This would hopefully be 0.15 someday.
Best regards,
Christian
could you look at those changes to tar.tcl?
I'm using this customized untar function to be able to pass multiple
files to the function when unpacking. Sorry for not making an official
pull requst, but since I cannot find the current version online, It's probably the best:
Am 07.09.2025 um 01:06 schrieb undroidwish:
On 9/6/25 22:25, meshparts wrote:
… The last version I could find is 0.13: https://github.com/tcltk/
tcllib/blob/master/modules/tar/tar.tcl
Where do I get 0.14?
The canonical source of tcllib is not on github but in a fossil
repository below https://core.tcl-lang.org, see
https://core.tcl-lang.org/tcllib/doc/trunk/embedded/index.md
So on github you find a more or (in your case) less synchronized
copy of it.
Better for you, Luke, if you search the real, true force,
Christian
The force got me there already.
I downloaded the tcllib release 2.0 but that contains only tar 0.13.
Now I tried to download the latest snapshot (https://core.tcl-lang.org/ tcllib/wiki?name=Downloads) and the webpage seems to have a technical
issue: It loops endlessly around that "checking you are not a robot..." thing.
Is there another way?
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,071 |
Nodes: | 10 (0 / 10) |
Uptime: | 44:56:21 |
Calls: | 13,751 |
Calls today: | 1 |
Files: | 186,981 |
D/L today: |
17,279 files (5,276M bytes) |
Messages: | 2,423,364 |