File: tar-mode.el.html

This package attempts to make dealing with Unix 'tar' archives easier.

When this code is loaded, visiting a file whose name ends in '.tar' will cause the contents of that archive file to be displayed in a Dired-like listing. It is then possible to use the customary Dired keybindings to extract sub-files from that archive, either by reading them into their own editor buffers, or by copying them directly to arbitrary files on disk. It is also possible to delete sub-files from within the tar file and write the modified archive back to disk, or to edit sub-files within the archive and re-insert the modified files into the archive. See the documentation string of tar-mode for more info.

This code now understands the extra fields that GNU tar adds to tar files.

Do not attempt to use tar-mode.el with crypt.el, you will lose.

   *************** TO DO ***************

o chmod should understand "a+x,og-w".

o The code is less efficient that it could be - in a lot of places, I
   pull a 512-character string out of the buffer and parse it, when I could
   be parsing it in place, not garbaging a string. Should redo that.

o I'd like a command that searches for a string/regexp in every subfile
   of an archive, where <esc> would leave you in a subfile-edit buffer.
   (Like the Meta-R command of the Zmacs mail reader.)

o Sometimes (but not always) reverting the tar-file buffer does not
   re-grind the listing, and you are staring at the binary tar data.
   Typing 'g' again immediately after that will always revert and re-grind
   it, though. I have no idea why this happens.

o Tar-mode interacts poorly with crypt.el and zcat.el because the tar
   write-file-hook actually writes the file. Instead it should remove the
   header (and conspire to put it back afterwards) so that other write-file
   hooks which frob the buffer have a chance to do their dirty work. There
   might be a problem if the tar write-file-hook does not come *first* on
   the list.

o Block files, sparse files, continuation files, and the various header
   types aren't editable. Actually I don't know that they work at all.

Rationale:

Why does tar-mode edit the file itself instead of using tar?

That means that you can edit tar files which you don't have room for on your local disk.

I don't know about recent features in gnu tar, but old versions of tar can't replace a file in the middle of a tar file with a new version. Tar-mode can. I don't think tar can do things like chmod the subfiles. An implementation which involved unpacking and repacking the file into some scratch directory would be very wasteful, and wouldn't be able to preserve the file owners.

Defined variables (17)

tar-anal-blocksizeThe blocksize of tar files written by Emacs, or nil, meaning don’t care.
tar-copy-preserve-timeNon-nil means that Tar mode preserves the timestamp when copying files.
tar-data-bufferBuffer that holds the actual raw tar bytes.
tar-data-swappedIf non-nil, ‘tar-data-buffer’ indeed holds raw tar bytes.
tar-mode-abbrev-tableAbbrev table for ‘tar-mode’.
tar-mode-hookHook run after entering Tar mode.
tar-mode-immediate-menuImmediate menu for Tar mode.
tar-mode-mapLocal keymap for Tar mode listings.
tar-mode-mark-menuMark menu for Tar mode.
tar-mode-operate-menuOperate menu for Tar mode.
tar-mode-show-dateNon-nil means Tar mode should show the date/time of each subfile.
tar-mode-syntax-tableSyntax table for ‘tar-mode’.
tar-subfile-modeNon-nil if Tar-Subfile mode is enabled.
tar-subfile-mode-hookHook run after entering or leaving ‘tar-subfile-mode’.
tar-superior-bufferBuffer containing the tar archive from which a member was extracted.
tar-superior-descriptorTar descriptor for a member extracted from an archive.
tar-update-datestampNon-nil means Tar mode should play fast and loose with sub-file datestamps.

Defined functions (96)

copy-tar-header(ARG)
make-tar-header(DATA-START NAME MODE UID GID SIZE DATE CHECKSUM LINK-TYPE LINK-NAME MAGIC UNAME GNAME DMAJ DMIN)
make-tar-header--cmacro(CL-WHOLE-ARG DATA-START NAME MODE UID GID SIZE DATE CHECKSUM LINK-TYPE LINK-NAME MAGIC UNAME GNAME DMAJ DMIN)
tar--check-descriptor(DESCRIPTOR)
tar--describe-as-link(DESCRIPTOR)
tar--extract(DESCRIPTOR)
tar--pad-to(POS)
tar--put-at(POS VAL &optional FMT MASK)
tar-alter-one-field(DATA-POSITION NEW-DATA-STRING &optional DESCRIPTOR)
tar-chgrp-entry(NEW-GID)
tar-chmod-entry(NEW-MODE)
tar-chown-entry(NEW-UID)
tar-clear-modification-flags()
tar-clip-time-string(TIME)
tar-copy(&optional TO-FILE)
tar-current-descriptor(&optional NOERROR)
tar-current-position()
tar-data-swapped-p()
tar-display-other-window()
tar-expunge(&optional NOCONFIRM)
tar-expunge-internal()
tar-extract(&optional OTHER-WINDOW-P)
tar-extract-other-window()
tar-file-name-handler(OP &rest ARGS)
tar-flag-deleted(P &optional UNFLAG)
tar-get-file-descriptor(FILE)
tar-goto-file(FILE)
tar-grind-file-mode(MODE)
tar-header-block-check-checksum(HBLOCK DESIRED-CHECKSUM FILE-NAME)
tar-header-block-checksum(STRING)
tar-header-block-summarize(TAR-HBLOCK &optional MOD-P)
tar-header-block-tokenize(POS CODING &optional DISABLE-SLASH)
tar-header-checksum(CL-X)
tar-header-checksum--cmacro(CL-WHOLE-ARG CL-X)
tar-header-data-end(DESCRIPTOR)
tar-header-data-start(CL-X)
tar-header-data-start--cmacro(CL-WHOLE-ARG CL-X)
tar-header-date(CL-X)
tar-header-date--cmacro(CL-WHOLE-ARG CL-X)
tar-header-dmaj(CL-X)
tar-header-dmaj--cmacro(CL-WHOLE-ARG CL-X)
tar-header-dmin(CL-X)
tar-header-dmin--cmacro(CL-WHOLE-ARG CL-X)
tar-header-gid(CL-X)
tar-header-gid--cmacro(CL-WHOLE-ARG CL-X)
tar-header-gname(CL-X)
tar-header-gname--cmacro(CL-WHOLE-ARG CL-X)
tar-header-header-start(CL-X)
tar-header-header-start--cmacro(CL-WHOLE-ARG CL-X)
tar-header-link-name(CL-X)
tar-header-link-name--cmacro(CL-WHOLE-ARG CL-X)
tar-header-link-type(CL-X)
tar-header-link-type--cmacro(CL-WHOLE-ARG CL-X)
tar-header-magic(CL-X)
tar-header-magic--cmacro(CL-WHOLE-ARG CL-X)
tar-header-mode(CL-X)
tar-header-mode--cmacro(CL-WHOLE-ARG CL-X)
tar-header-name(CL-X)
tar-header-name--cmacro(CL-WHOLE-ARG CL-X)
tar-header-p(CL-X)
tar-header-p--cmacro(CL-WHOLE-ARG CL-X)
tar-header-serialize(HEADER &optional UPDATE-CHECKSUM)
tar-header-size(CL-X)
tar-header-size--cmacro(CL-WHOLE-ARG CL-X)
tar-header-uid(CL-X)
tar-header-uid--cmacro(CL-WHOLE-ARG CL-X)
tar-header-uname(CL-X)
tar-header-uname--cmacro(CL-WHOLE-ARG CL-X)
tar-mode()
tar-mode-immediate-menu(ARG1)
tar-mode-mark-menu(ARG1)
tar-mode-operate-menu(ARG1)
tar-mode-revert(&optional NO-AUTO-SAVE NO-CONFIRM)
tar-mouse-extract(EVENT)
tar-new-entry(FILENAME &optional INDEX)
tar-new-regular-file-header(FILENAME &optional SIZE TIME)
tar-next-file-displayer(FILE REGEXP N)
tar-next-line(ARG)
tar-octal-time(TIMEVAL)
tar-pad-to-blocksize()
tar-parse-octal-integer(STRING &optional START END)
tar-parse-octal-integer-safe(STRING)
tar-parse-octal-long-integer(STRING &optional START END)
tar-previous-line(ARG)
tar-read-file-name(&optional PROMPT)
tar-rename-entry(NEW-NAME)
tar-roundup-512(S)
tar-subfile-mode(&optional ARG)
tar-subfile-save-buffer()
tar-summarize-buffer()
tar-swap-data()
tar-unflag(P)
tar-unflag-backwards(P)
tar-untar-buffer()
tar-view()
tar-write-region-annotate(START END)

Defined faces (0)