Skip Menu |

This queue is for tickets about the File-Copy-Recursive CPAN distribution.

Report information
The Basics
Id: 124423
Status: resolved
Priority: 0/
Queue: File-Copy-Recursive

People
Owner: Nobody in particular
Requestors: DROLSKY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Expecting copy to return 0 when given a dir is not correct
The fcopy() sub calls File::Copy::copy() and expects it to return false when the from parameter is a directory. However, on HPUX this is not the case. I think this is a bug in copy(), but until it's fixed you may want to work around it. Please see https://rt.perl.org/Ticket/Display.html?id=132866 for my File::Copy bug report. I've also attached a patch which gets tests passing on HPUX, but it's not a great fix.
Subject: File-Copy-Recursive-hpux-fcopy-test-failure.patch
From fecf359afa945dedde36bf4a9baafce1f9ef489f Mon Sep 17 00:00:00 2001 From: Dave Rolsky <autarch@urth.org> Date: Tue, 13 Feb 2018 11:58:38 -0600 Subject: [PATCH] Skip a test that fails on HPUX because HPUX is weird Apparently calling open() on a directory on HPUX succeeds and reading the filehandle returns some directory listing info. --- t/01.legacy.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/01.legacy.t b/t/01.legacy.t index 1f93d25..6d454e8 100644 --- a/t/01.legacy.t +++ b/t/01.legacy.t @@ -72,8 +72,11 @@ note "functionality w/ default globals"; my @fcopy_rv = fcopy( "$tmpd/orig/data", "$tmpd/fcopyexisty" ); is( path("$tmpd/orig/data")->slurp, path("$tmpd/fcopyexisty")->slurp, "fcopy() defaults as expected when target does exist" ); - $rv = fcopy( "$tmpd/orig", "$tmpd/fcopy" ); - ok( !$rv, "fcopy() returns false if source is a directory" ); + SKIP: { + skip 'On HPUX opening a directory "works" and this test does not fail', 1 if $^O eq 'hpux'; + $rv = fcopy( "$tmpd/orig", "$tmpd/fcopy" ); + ok( !$rv, "fcopy() returns false if source is a directory" ); + } } # fmove() WiP -- 2.16.1
Thanks Dave!!! On Tue Feb 13 18:20:41 2018, DROLSKY wrote: Show quoted text
> The fcopy() sub calls File::Copy::copy() and expects it to return > false when the from parameter is a directory. However, on HPUX this is > not the case. I think this is a bug in copy(), but until it's fixed > you may want to work around it. > > Please see https://rt.perl.org/Ticket/Display.html?id=132866 for my > File::Copy bug report. > > I've also attached a patch which gets tests passing on HPUX, but it's > not a great fix.
It turns out this isn't just on HPUX. I've seen this test now fail on Windows too. I think this assumption about how copy() works is just wrong.
On Wed Feb 21 14:19:15 2018, DROLSKY wrote: Show quoted text
> It turns out this isn't just on HPUX. I've seen this test now fail on > Windows too. I think this assumption about how copy() works is just > wrong.
thanks again, should be addressed in the next release: c3c6be6 rt 124423 - have fcopy() work around File::Copy::copy() bug rt132866 (thanks DROLSKY)