summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
authorJames E Keenan <jkeenan@cpan.org>2017-11-12 18:10:28 -0500
committerJames E Keenan <jkeenan@cpan.org>2017-11-12 18:10:28 -0500
commit83aebc99b27428f0566bab5ded4d1df2167a9d4a (patch)
tree90790b6d749bc40f15009a85a0bff522e4b2155c /lib/File
parent70747554497f9cb03e742ab188049b9d1e784020 (diff)
parentd7408e7abbe17d95fb4d605ca2724e06b38c0608 (diff)
downloadperl-83aebc99b27428f0566bab5ded4d1df2167a9d4a.tar.gz
Merge branch 'smoke-me/jkeenan/afresh/132401-file-copy' into blead
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/Copy.pm4
-rw-r--r--lib/File/Copy.t7
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm
index 47e6429771..b796451e37 100644
--- a/lib/File/Copy.pm
+++ b/lib/File/Copy.pm
@@ -16,13 +16,15 @@ use Config;
# And then we need these games to avoid loading overload, as that will
# confuse miniperl during the bootstrap of perl.
my $Scalar_Util_loaded = eval q{ require Scalar::Util; require overload; 1 };
+# We want HiRes stat and utime if available
+BEGIN { eval q{ use Time::HiRes qw( stat utime ) } };
our(@ISA, @EXPORT, @EXPORT_OK, $VERSION, $Too_Big, $Syscopy_is_copy);
sub copy;
sub syscopy;
sub cp;
sub mv;
-$VERSION = '2.32';
+$VERSION = '2.33';
require Exporter;
@ISA = qw(Exporter);
diff --git a/lib/File/Copy.t b/lib/File/Copy.t
index 25f340d1c0..57d9478a68 100644
--- a/lib/File/Copy.t
+++ b/lib/File/Copy.t
@@ -24,6 +24,11 @@ BEGIN { *CORE::GLOBAL::rename = sub { CORE::rename($_[0], $_[1]) }; }
use File::Copy qw(copy move cp);
use Config;
+# If we have Time::HiRes, File::Copy loaded it for us.
+BEGIN {
+ eval { Time::HiRes->import(qw( stat utime )) };
+ note "Testing Time::HiRes::utime support" unless $@;
+}
foreach my $code ("copy()", "copy('arg')", "copy('arg', 'arg', 'arg', 'arg')",
"move()", "move('arg')", "move('arg', 'arg', 'arg')"
@@ -102,7 +107,7 @@ for my $cross_partition_test (0..1) {
ok -e "copy-$$", ' target still there';
# Doesn't really matter what time it is as long as its not now.
- my $time = 1000000000;
+ my $time = 1000000000.12345;
utime( $time, $time, "copy-$$" );
# Recheck the mtime rather than rely on utime in case we're on a