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