[comp.unix.questions] 14 char filename limit

snoopy@doghouse.gwd.tek.com (Snoopy) (08/13/87)

In article <6279@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:

>All "ar" utilities I know of, including 4.2BSD's, restrict member names
>to something like 14 or 16 characters.  Thus the problem is not restricted
>to COFF filename entries.

UTek's ar(1) allows long filenames. (unless the -n (normal format) flag
is given) The magic 'number' for archives containing long filenames changes
from "arch" to "ARCH".  The rcs message says David Elliot checked it in,
so it's probably his doing.

Snoopy
tektronix!doghouse.gwd!snoopy
snoopy@doghouse.gwd.tek.com

"And it's a middle-endian machine with trinary logic."
"They would do that."

dce@mips.UUCP (David Elliott) (08/14/87)

In article <8985@tekecs.TEK.COM> snoopy@doghouse.gwd.tek.com (Snoopy) writes:
>In article <6279@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>
>>All "ar" utilities I know of, including 4.2BSD's, restrict member names
>>to something like 14 or 16 characters.  Thus the problem is not restricted
>>to COFF filename entries.
>
>UTek's ar(1) allows long filenames. (unless the -n (normal format) flag
>is given) The magic 'number' for archives containing long filenames changes
>from "arch" to "ARCH".  The rcs message says David Elliot checked it in,
>so it's probably his doing.

Steve Glaser and I came up with this. The idea was pretty simple, but the
implementation is more complicated.

What happens is that the UTek ar has 2 formats. The standard format
is unchanged from 4.2. The new format has the magic number "!<ARCH>",
and has two types of records: 4.2-style and a special type of record
with the name enclosed in slashes (a "filename" can't contain slashes).

The two record types co-exist so that if an archive is found to only
have members with short names, the magic number is changed back to
"!<arch>".

In order to read archive headers, the routines getarhdr() and fgetarhdr()
are supplied. These read an archive member header from the file given
by the file descriptor or FILE pointer, and place it into a structure
that contains the standard archive member information, with a pointer
to a null-terminated name, and the length of the name.

This actually simplified commands like make and nm, but ld was a bear,
since it knows a lot about the format.

Now, anyone want to hear how you can change cpio to handle long
device numbers and/or long inode numbers without losing data or
even changing the magic number?

-- 
David Elliott		{decvax,ucbvax,ihnp4}!decwrl!mips!dce

gwyn@brl-smoke.ARPA (Doug Gwyn ) (08/18/87)

In article <596@quacky.UUCP> dce@quacky.UUCP (David Elliott) writes:
-Now, anyone want to hear how you can change cpio to handle long
-device numbers and/or long inode numbers without losing data or
-even changing the magic number?

Yes, please!