copydir: new package

We want a recursive copy function so that we can avoid executing /bin/cp
in supposedly isolated test suites. cp isn't always in /bin; not every /bin/cp
works the same.
On 9 June 2014 18:47, Nate Finch <notifications@github.com> wrote:
>
> In copydir/copy.go:
>
> > +package copydir
> > +
> > +import (
> > + "fmt"
> > + "io"
> > + "os"
> > + "path/filepath"
> > +)
> > +
> > +// Copy recursively copies the file at src to dst. The destination must
> > +// not exist.Symbolic links are
> > +// not followed.
> > +//
> > +// If the copy fails half way through, the destination might be
> > +// left partially written.
> > +func Copy(src, dst string) error {
>
> I think the comments could use some explanation as to why this function exists rather than using the OS's file copy... and the difference in functionality between this and the OS file copy (e.g. change in owner, last modified date, etc).

I'm not quite sure what you mean by "the OS's file copy" here. Do you mean
the cp(1) command? If so, I'm not sure what the exact semantics of that command
are (it varies between OSs), and AFAIK no cp implementation copies the owner or
modification time unless specific flags are provided.

Do we really need a rationalisation for implementing something in Go rather than
invoking an external process?

If you have a specific suggestion for a comment, I'd be more than
happy to consider it.