 ! Vendor extended header type
 : typeflag-X ( header -- ) unknown-typeflag ;
 
-: (parse-tar) ( -- )
+: parse-tar ( -- )
     block-size read dup length block-size = [
         parse-tar-header
         dup typeflag>>

TUPLE: tar-header name mode uid gid size mtime checksum typeflag
linkname magic version uname gname devmajor devminor prefix ;

ERROR: checksum-error ;

: trim-string ( seq -- newseq ) [ "\0 " member? ] trim ;



! Long file name
: typeflag-L ( header -- )
    drop
    ;
    ! <string-writer> [ read-data-blocks ] keep
    ! >string [ zero? ] trim-tail filename set
    ! filename get prepend-current-directory make-directories ;
