[comp.unix.questions] u option for ar

dhm@necis.UUCP (Dave Mitchell) (05/06/89)

I am in need of information on the ar command. I am updating documentation and
there is none for the u option with ar. I have used ar with the u option but
couldn't determine what it does. The source code wasn't a help either. If anyone
knows what it does and if there is any documentation available, your help would
be appreciated.

*****************************************************************************

David Mitchell                          dhm@necis.nec.com
NEC Information Systems, Inc.
1300 Massachusetts Avenue
Boxborough, Mass. 01719                 508-635-6278
                      
*****************************************************************************

chris@mimsy.UUCP (Chris Torek) (05/06/89)

In article <1034@necis.UUCP> dhm@necis.UUCP (Dave Mitchell) writes:
>... I have used ar with the u option but couldn't determine what it
>does. The source code wasn't a help either.

It was for me :-)

According to the source, `ar u' is an alias for `ar r', except that
it will not replace the sub-file in the archive unless the real file
is newer.  That is:

	% ar crv foo.a foo.o
	a - foo.o
	% ar rv foo.a foo.o
	r - foo.o
	% ar uv foo.a foo.o
	% touch foo.o
	% ar uv foo.a foo.o
	r - foo.o
	%

(and I even tested it, after writing this :-) )
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris