9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Is there `cp -r fdir/ tdir/` equivalent?
@ 2007-08-03 21:42 Alexandre Vassalotti
  2007-08-03 21:43 ` Gorka Guardiola
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexandre Vassalotti @ 2007-08-03 21:42 UTC (permalink / raw)
  To: 9fans

Hi,

I recently installed plan9 on a spare drive and started to play with
it. I love the design of the system. The code is clean, so plan9 is
perfect for someone like me who likes to tinker and learn how
computers really works.

The only thing that slightly bothers me, is that the standard Unix
tools I am used to are relatively minimal. Although, I understand that
is probably by design -- i.e, easier maintenance.

Anyway, all that to ask if there is an equivalent of `cp -r fdir/
tdir/` for making a copy of a directory. If not then it is not a
problem, I will just add  the recursive option to cp(1) myself.

Thanks,
-- Alexandre


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Is there `cp -r fdir/ tdir/` equivalent?
  2007-08-03 21:42 [9fans] Is there `cp -r fdir/ tdir/` equivalent? Alexandre Vassalotti
@ 2007-08-03 21:43 ` Gorka Guardiola
  2007-08-03 21:45 ` Kris Maglione
  2007-08-03 21:50 ` Martin Neubauer
  2 siblings, 0 replies; 7+ messages in thread
From: Gorka Guardiola @ 2007-08-03 21:43 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>
> Anyway, all that to ask if there is an equivalent of `cp -r fdir/
> tdir/` for making a copy of a directory. If not then it is not a

dircp


-- 
- curiosity sKilled the cat


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Is there `cp -r fdir/ tdir/` equivalent?
  2007-08-03 21:42 [9fans] Is there `cp -r fdir/ tdir/` equivalent? 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
  2 siblings, 1 reply; 7+ messages in thread
From: Kris Maglione @ 2007-08-03 21:45 UTC (permalink / raw)
  To: 9fans

http://plan9.bell-labs.com/wiki/plan9/UNIX_to_Plan_9_command_translation/index.html

@{cd $a; tar c .} | tar x

There are plenty of scripts to do it on sources, or you can 
instell Inferno and use its fcp -r.

-- 
Kris Maglione

Left to themselves, all things go from bad to worse.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Is there `cp -r fdir/ tdir/` equivalent?
  2007-08-03 21:42 [9fans] Is there `cp -r fdir/ tdir/` equivalent? Alexandre Vassalotti
  2007-08-03 21:43 ` Gorka Guardiola
  2007-08-03 21:45 ` Kris Maglione
@ 2007-08-03 21:50 ` Martin Neubauer
  2007-08-03 22:16   ` geoff
  2007-08-05  0:50   ` Alexandre Vassalotti
  2 siblings, 2 replies; 7+ messages in thread
From: Martin Neubauer @ 2007-08-03 21:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

* Alexandre Vassalotti (alexandre@peadrop.com) wrote:
> The only thing that slightly bothers me, is that the standard Unix
> tools I am used to are relatively minimal.

Why not using the standard Plan 9 tools instead?

> 
> Anyway, all that to ask if there is an equivalent of `cp -r fdir/
> tdir/` for making a copy of a directory. If not then it is not a
> problem, I will just add  the recursive option to cp(1) myself.

More seriously, the normal approach would be using tar. This and some more
can be found in the 9fans archives or at
http://plan9.bell-labs.com/wiki/plan9/UNIX_to_Plan_9_command_translation/index.html .

	Martin



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Is there `cp -r fdir/ tdir/` equivalent?
  2007-08-03 21:50 ` Martin Neubauer
@ 2007-08-03 22:16   ` geoff
  2007-08-05  0:50   ` Alexandre Vassalotti
  1 sibling, 0 replies; 7+ messages in thread
From: geoff @ 2007-08-03 22:16 UTC (permalink / raw)
  To: 9fans

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Is there `cp -r fdir/ tdir/` equivalent?
  2007-08-03 21:45 ` Kris Maglione
@ 2007-08-05  0:50   ` Alexandre Vassalotti
  0 siblings, 0 replies; 7+ messages in thread
From: Alexandre Vassalotti @ 2007-08-05  0:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 8/3/07, Kris Maglione <bsdaemon@comcast.net> wrote:
> http://plan9.bell-labs.com/wiki/plan9/UNIX_to_Plan_9_command_translation/index.html
>

Thanks, for this links. That will help me a lot.

> @{cd $a; tar c .} | tar x
>

Oh, thanks for this trick too.

-- Alexandre


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] Is there `cp -r fdir/ tdir/` equivalent?
  2007-08-03 21:50 ` Martin Neubauer
  2007-08-03 22:16   ` geoff
@ 2007-08-05  0:50   ` Alexandre Vassalotti
  1 sibling, 0 replies; 7+ messages in thread
From: Alexandre Vassalotti @ 2007-08-05  0:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 8/3/07, Martin Neubauer <m.ne@gmx.net> wrote:
>
> Why not using the standard Plan 9 tools instead?
>

Because I don't know them yet. ;)

-- Alexandre


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-05  0:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-03 21:42 [9fans] Is there `cp -r fdir/ tdir/` equivalent? 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
2007-08-05  0:50   ` Alexandre Vassalotti

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).