emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] support filename prefixes and 100-character filenames in tar-mod


From: David Glasser
Subject: [PATCH] support filename prefixes and 100-character filenames in tar-mode.el
Date: Fri, 11 Apr 2008 10:51:55 -0700

I noticed this morning that when opening a tarball containing a file
with a long filename in tar-mode, the entry for that file didn't list
the full filename; it only listed some suffix of the filename.  I did
some digging and found that newish tar standards (among others)
support a "prefix" field in the tar header block to overcome tar
format limitations; however, tar-mode doesn't support it.

You should be able to test this by opening the attached tarball.  The
correct output should look something like:

 drwxr-x--- glasser/eng           0 foo1
 drwxr-x--- glasser/eng           0 foo1/foo2
 drwxr-x--- glasser/eng           0 foo1/foo2/foo3
 drwxr-x--- glasser/eng           0 foo1/foo2/foo3/foo4
 drwxr-x--- glasser/eng           0 foo1/foo2/foo3/foo4/foo5
 drwxr-x--- glasser/eng           0 foo1/foo2/foo3/foo4/foo5/foo6
 drwxr-x--- glasser/eng           0 foo1/foo2/foo3/foo4/foo5/foo6/foo7
 drwxr-x--- glasser/eng           0 foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8
 drwxr-x--- glasser/eng           0 foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12/foo13
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12/foo13/foo14
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12/foo13/foo14/foo15
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12/foo13/foo14/foo15/foo16
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12/foo13/foo14/foo15/foo16/foo17
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12/foo13/foo14/foo15/foo16/foo17/foo18
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12/foo13/foo14/foo15/foo16/foo17/foo18/foo19
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12/foo13/foo14/foo15/foo16/foo17/foo18/foo19/foo20
 drwxr-x--- glasser/eng           0
foo1/foo2/foo3/foo4/foo5/foo6/foo7/foo8/foo9/foo10/foo11/foo12/foo13/foo14/foo15/foo16/foo17/foo18/foo19/foo20/foo21

Without my patch at all, the bottom few look like they aren't inside foo1/foo2/.

With all of the patch except for the change in the initial
initialization of name-end, the results look correct, except the
penultimate line ends in "foo2" instead of "foo20"; that is because
the name field here fill the entire field with no nulls, but the code
previously assumed there would be at least one null.  (It's possible
that similar adjustments are required for the initial values of
link-end, gname-end, and uname-end.)

Let me know if this is a significant enough change that papers are necessary.

Also, please note that until an hour ago I had no idea what the TAR
format looked like!

--dave

-- 
David Glasser | address@hidden | http://www.davidglasser.net/

Attachment: tar-prefix.patch.txt
Description: Text document

Attachment: test.tar.gz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]