Building files from other files

Paul Jackson pj at sam.sgi.com
Wed Feb 14 15:33:43 AEST 1990


In article <9002121455.aa22106 at SMOKE.BRL.MIL> JORDAN at gmr.COM writes:
	(to paraphrase)

| We work in a real time environment, and have noticed something strange
| in a particular "driving" loop.
| 	a.c				# a.c has OK performance
| 	cp a.c a.copy			# a.copy has OK performance
| 	cat b.c >> a.copy		# now a.copy has slow performance
| 	"delete b.c from a.copy"	# a.copy still has slow performance

How did you delete b.c from a.copy?  Unix has no way to shorten a
file while it is in place on the disk.  I presume you deleted b.c
by using an editor (such as vi).  All editors work by making
copies of the file, applying the changes and linking or copying
the result back.  This reallocates the disk space used for that
file.

I would guess perhaps that a.copy, after b.c was added,
spanned multiple extents.  And I would also guess that
after "deleting b.c ...", a.copy still took multiple extents.
That it still took multiple extents is a little surprising,
as our (yes - I work for SGI) Extent-based File System does
a pretty good job of keeping files together that are written
in one open-write-write-...-close sequence.  But it certainly
is possible.

To further improve this guess, one would need to know the sizes
of the files, and how much space was free on the disk partition
after each of the above steps.  Allocating contiguous extents is
harder on a nearly full disk.

Why don't you try calling our Geometry Hotline (800) 345-0222.
These folks do a real fine job of handling such questions.
I use them myself.

				Thanks, take care ...
				Paul Jackson (pj at asd.sgi.com), x1373



More information about the Comp.sys.sgi mailing list