Xref: utzoo comp.sources.d:2249 comp.unix.questions:7462 Path: utzoo!dciem!nrcaer!scs!spl1!lll-winken!lll-tis!ames!pacbell!att!chinet!les From: les@chinet.UUCP (Leslie Mikesell) Newsgroups: comp.sources.d,comp.unix.questions Subject: Re: cpio/afio writing directories? Message-ID: <5739@chinet.UUCP> Date: 2 Jun 88 18:39:07 GMT Article-I.D.: chinet.5739 References: <23@libove.UUCP> Reply-To: les@chinet.UUCP (Leslie Mikesell) Distribution: comp Organization: Chinet - Public Access Unix Lines: 27 In article <23@libove.UUCP> root@libove.UUCP (The Super User) writes: > >My question: How do I tell afio/cpio that > >% echo '/x /y /z' | afio -o > >means /x /y /z and all subfiles also? The usual way is to use find instead of echo: find dir1 dir2 dir3 -depth -print |afio -o The -depth flag causes the directories themselves to be printed last so the modes will restore properly and makes it possible to deal with read-only directories. Be sure you know what you are doing if you use (or don't use) absolute pathnames for the starting directories. If you start with a /, then the restore operation will only be able to put the files back into their original absolute positions. If you cd to the starting point and find ".", or one above and find "dirnname", then the files will restore relative to your current directory. Has anyone hacked afio to strip an optional number of leading directories from the path during a restore? Something like the -pn parameter in patch would be nice. Les Mikesell