develooper Front page | perl.perl5.porters | Postings from July 2013

Re: Recommended file-copying method

Thread Previous | Thread Next
Mark Overmeer
July 7, 2013 14:44
Re: Recommended file-copying method
Message ID:
* Leon Timmermans ( [130707 14:04]:
> On Sun, Jul 7, 2013 at 5:20 AM, Ken Williams <> wrote:
> > I'm about to add a $file->copy($destination) method to Path::Class.  I was
> > about to use File::Copy's copy() function, but then I noticed the cp() and
> > syscopy() alternatives, each of which has additional niceties (the former
> > preserves permissions - the latter seems to DTRT better on Windows and other
> > non-Unixalikes) but neither has both niceties people probably want.
> I don't think this makes much sense as a method. Copying is not an
> operation of one subject, but one of two equals. Or said otherwise,
> why would it be a method of the source and not of the destination?

Copy is like clone(), but on file-system level.  When you accept that a
file is just a (complex) data-type like any other,
$file->copy($destination) is the obvious syntax.

       Mark Overmeer MSc                                MARKOV Solutions                         

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About