cpio/afio writing directories?

Leslie Mikesell les at chinet.UUCP
Fri Jun 3 04:39:07 AEST 1988


In article <23 at libove.UUCP> root at 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



More information about the Comp.unix.questions mailing list