328
329
330
331
332
333
334
335
336
337
338
339
340
341
|
# comments the chunk may start at an arbitrary distance from the
# end of the file. So if we do not find the header immediately
# we have to extend the range of our search, possibly until we
# have a large part of the archive in memory. We can fail only
# after the whole file has been searched.
set sz [tell $fd]
set len 512
set at 512
while {1} {
if {$sz < $at} {set n -$sz} else {set n -$at}
seek $fd $n end
set hdr [read $fd $len]
|
>
>
>
>
>
|
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
|
# comments the chunk may start at an arbitrary distance from the
# end of the file. So if we do not find the header immediately
# we have to extend the range of our search, possibly until we
# have a large part of the archive in memory. We can fail only
# after the whole file has been searched.
set sz [tell $fd]
if {[info exists ::zip::max_header_seek]} {
if {$::zip::max_header_seek < $sz} {
set sz $::zip::max_header_seek
}
}
set len 512
set at 512
while {1} {
if {$sz < $at} {set n -$sz} else {set n -$at}
seek $fd $n end
set hdr [read $fd $len]
|