develooper Front page | perl.perl5.porters | Postings from April 2008

Re: One less File::Copy bug

Thread Previous | Thread Next
Johan Vromans
April 28, 2008 03:22
Re: One less File::Copy bug
Message ID:
Aristotle Pagaltzis <> writes:

> What might then be sensible is to add an import flag to say “give
> me `syscopy` where I ask for `copy`” once it is fixed.

I would make a distinction between copying files and copying data.
What File::Copy currently does, is copying data. File::CopyData would
have been a better name. Or a copydata function instead of copy.
Copying a file (as with the corresponding system commands) does a bit
more than that. It deals with file attributes, handles directories,
and so on.

I would propose to a) cleary define the desired semantics of copy and
b) implement this. There is no need for a BUFFERSIZE argument. There
is no need for syscopy, copy should do the right job. There's no need
for a cp alias.

Increase the version number to 3.00. Automatically provide the new
semantics if the user explicitly requires the new version:

  use File::Copy 3.0;

As a side note: Wouldn't we all have a good laugh when, say,
Microsoft, wrote in the docs:

  [...] also provides the syscopy routine, which copies [...]
  preserving OS-specific attributes and file structure. For Unix
  systems, this is equivalent to the simple copy routine, which
  doesn't preserve OS-specific attributes.

This is just stupid.

-- Johan

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