decompression

This commit is contained in:
~d6 2024-09-27 22:49:12 -04:00
parent 4f0a9dfdbe
commit 12b6a5c3e6
1 changed files with 16 additions and 4 deletions

20
tar.tal
View File

@ -86,7 +86,7 @@
DUP LIT "0 EQU ?list-file-v ( type^ ) DUP LIT "0 EQU ?list-file-v ( type^ )
DUP LIT "5 EQU ?list-dir-v ( type^ ) DUP LIT "5 EQU ?list-dir-v ( type^ )
DUP LIT "7 EQU ?list-file-v ( type^ ) DUP LIT "7 EQU ?list-file-v ( type^ )
!list-weird-v !list-unsupported-v
( !fail-unsupported ) ( ) ( !fail-unsupported ) ( )
( non-verbose file entry listing ) ( non-verbose file entry listing )
@ -104,7 +104,7 @@
!list-entries !list-entries
( verbose file entry listing ) ( verbose file entry listing )
@list-weird-v ( type^ -> ) @list-unsupported-v ( type^ -> )
( POP ) ( POP )
( LIT "f ) #18 DEO #2018 DEO ( LIT "f ) #18 DEO #2018 DEO
;header/size load-octal11 dump-longer #2018 DEO ;header/size load-octal11 dump-longer #2018 DEO
@ -114,7 +114,7 @@
( dump-header ) ( dump-header )
;header/size .File2/name DEO2 ;header/size .File2/name DEO2
;header/size load-octal11 STH2k write ;header/size load-octal11 STH2k skip
STH2r remainder-512 skip-lo !list-entries STH2r remainder-512 skip-lo !list-entries
( verbose file entry listing ) ( verbose file entry listing )
@ -151,7 +151,8 @@
DUP LIT "0 EQU ?expand-file ( type^ ) DUP LIT "0 EQU ?expand-file ( type^ )
DUP LIT "5 EQU ?expand-dir ( type^ ) DUP LIT "5 EQU ?expand-dir ( type^ )
DUP LIT "7 EQU ?expand-file ( type^ ) DUP LIT "7 EQU ?expand-file ( type^ )
!fail-unsupported ( ) !expand-unsupported
( !fail-unsupported ) ( )
( remove leading / of an absolute path ) ( remove leading / of an absolute path )
@sanitize-path ( s* -> s1* ) @sanitize-path ( s* -> s1* )
@ -177,6 +178,16 @@
#0001 .File2/w DEO2 #0001 .File2/w DEO2
!expand-entries !expand-entries
@expand-unsupported ( type^ -> )
;skipped-unsupported print
#18 DEO LIT2 ": 18 DEO #2018 DEO
;header/filename sanitize-path
DUP2 #0064 lprint
#0a18 DEO
.File2/name DEO2
;header/size load-octal11 round-up-to-512 skip
!expand-entries
( src and dst should be paths ) ( src and dst should be paths )
@compress-entries ( src* dst* -> ) @compress-entries ( src* dst* -> )
POP2 POP2 JMP2r POP2 POP2 JMP2r
@ -377,6 +388,7 @@
@unsupported "unsupported 20 "format 20 00 @unsupported "unsupported 20 "format 20 00
@read-error "error 20 "reading 20 "data 0a 00 @read-error "error 20 "reading 20 "data 0a 00
@write-error "error 20 "writing 20 "data 0a 00 @write-error "error 20 "writing 20 "data 0a 00
@skipped-unsupported "skipped 20 "unsupported 20 "type 20 00
( load argument parser ) ( load argument parser )
~arg.tal ~arg.tal