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

->move_to broken/inconsistent if destination is a directory. #50

Open
hillu opened this issue Feb 26, 2018 · 0 comments
Open

->move_to broken/inconsistent if destination is a directory. #50

hillu opened this issue Feb 26, 2018 · 0 comments

Comments

@hillu
Copy link

hillu commented Feb 26, 2018

Situation at start, on Debian GNU/Linux:

$ ls -ld /tmp/x /tmp/y
-rw-r--r-- 1 bengen bengen    0 Feb 26 15:18 /tmp/x
drwxr-xr-x 2 bengen bengen 4096 Feb 26 15:14 /tmp/y

Using Path::Class 0.37, doing something like

$x = file("/tmp/x"); $x->move_to("/tmp/y");

moves the file into the directory /tmp/y, so we end up with a file /tmp/y/x, but updates the Path::Class::File object like this:

VAR1 = bless( {
                 'file' => 'y',
                 'file_spec_class' => undef,
                 'dir' => bless( {
                                   'volume' => '',
                                   'file_spec_class' => undef,
                                   'dirs' => [
                                               '',
                                               'tmp'
                                             ]
                                 }, 'Path::Class::Dir' )
               }, 'Path::Class::File' );

I'd expect the operation to fail (like it would when using CORE::rename or POSIX::rename) or to update the name correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant