Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please improve the class IO::Path routines copy() and move() #1453

Open
kolikov opened this issue Jan 29, 2018 · 3 comments
Open

Please improve the class IO::Path routines copy() and move() #1453

kolikov opened this issue Jan 29, 2018 · 3 comments
Labels
consensus needed Needs a well-versed decision with justification, possibly from a core developer IO

Comments

@kolikov
Copy link

kolikov commented Jan 29, 2018

Methods copy and move expect only a file as their $to argument

my $src = IO::Path.new('/home/zz/file.gz');
my $dest = IO::Path.new('/home/zz/tmp');
$src.move($dest);

Actual Behavior

Failed to move '/home/zz/zz.tar.gz' to '/home/zz/tmp': Failed to move file: illegal operation on a directory.

Expected Behavior

As a the good old 'cp' or 'mv' commands in Linux (move/copy the file into the target directory), as IO::Path has methods to identify files from directories, Make the 'move' and 'copy' a multi sub with a signature test for a file on $from and directory for $to.

That would be BTA 👍
Except if it breaks too much things ... or @zoffixznet 's heart :-)

Environment

@zoffixznet
Copy link
Contributor

👍 Makes sense to me.

Would also mirror how Perl 5's core File::Copy behaves.

@zoffixznet
Copy link
Contributor

zoffixznet commented Jul 10, 2018

👍 Makes sense to me.

After the discussions on #2043 , IMO this should be an ecosystem module first

@JJ JJ added the consensus needed Needs a well-versed decision with justification, possibly from a core developer label May 3, 2020
@doomvox
Copy link

doomvox commented Apr 28, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus needed Needs a well-versed decision with justification, possibly from a core developer IO
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants