9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: geoff@plan9.bell-labs.com
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Is there `cp -r fdir/ tdir/` equivalent?
Date: Fri,  3 Aug 2007 18:16:02 -0400	[thread overview]
Message-ID: <40a6a6ae1273d27a8bd312f221219bf8@plan9.bell-labs.com> (raw)
In-Reply-To: <20070803215055.GA85095@shodan.homeunix.net>

As Gorka said, use dircp.  It's been in /rc/bin for many years but
apparently wasn't documented.  I've added it to tar's manual page and
pushed the page out.

There are undoubtedly other undocumented programs in /rc/bin; it's
probably worthwhile to browse it.

Tar (thus dircp) doesn't copy Plan-9-specific metadata such as
append-only and exclusive-open permission bits, so if you need a
really accurate copy of a subtree, you'll probably want to use mkfs
and mkext.  They're a bit trickey to invoke correctly, but the
following script has worked for me:
---
#!/bin/rc
# dircpmk src dest - copy trees with mkfs|mkext
if (! ~ $#* 2) {
	echo usage: $0 src dest >[1=2]
	exit usage
}
# /sys/lib/sysconfig/proto/allproto just contains "+".
# mkext -v will verbosely describe extraction
disk/mkfs -a -s $1 /sys/lib/sysconfig/proto/allproto | disk/mkext -ud $2
---

It's a bit chatty and produces output like this:

processing /sys/lib/sysconfig/proto/allproto
file system made
done



  reply	other threads:[~2007-08-03 22:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03 21:42 Alexandre Vassalotti
2007-08-03 21:43 ` Gorka Guardiola
2007-08-03 21:45 ` Kris Maglione
2007-08-05  0:50   ` Alexandre Vassalotti
2007-08-03 21:50 ` Martin Neubauer
2007-08-03 22:16   ` geoff [this message]
2007-08-05  0:50   ` Alexandre Vassalotti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40a6a6ae1273d27a8bd312f221219bf8@plan9.bell-labs.com \
    --to=geoff@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).