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

Re: Recommended file-copying method

Thread Previous | Thread Next
Johan Vromans
July 9, 2013 06:32
Re: Recommended file-copying method
Message ID:
David Golden <> writes:

> I disagree with your point that copy "would imply making an identical
> copy (including file properties)" because that's simply your
> particular point of view on it.  Copying file properties is not always
> easy or possible, depending on ownership, permissions, filesystem,
> operating system, etc.

That's right. But at least we could try to make the copy as identical as
possible. That is precisely what the standard system tools [for a
reasonable definition of 'standard'] do. You can copy execute and rw
proerties, but without administrator rights you cannot ownership and
setuid properties.

> "...the cp utility
> copies the contents of the source_file to the target_file".  (Note the
> "contents" there.)

Also note "copies", not rewrites, reencodes etc..

> I don't think it's going to be any more confusing to
> people than File::Copy already is.

There's an apportunity here to make it less confusing.

Also: One of the main gripes about File::Copy::copy is that 

  copy( "foo", "bar", "destdir" )

behaves counter-intuitive.

Also also:


would lead me to believe that I get a copy of the object, not that the
data is suddenly stored to disk.

Just my thoughts.

-- Johan

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