Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Get rid of File::Copy, Rakudo has an IO::copy method now

  • Loading branch information...
commit ed7310a4e88ab1468976e56910cce9870a6688c8 1 parent 1ad23e0
Tadeusz Sośnierz authored March 13, 2011
34  lib/File/Copy.pm
... ...
@@ -1,34 +0,0 @@
1  
-use v6;
2  
-
3  
-module File::Copy;
4  
-
5  
-sub cp(Str $from, Str $to) is export {
6  
-	my $f1 = open $from, :r, :bin;
7  
-	my $f2 = open $to, :w, :bin;
8  
-	$f2.write($f1.read(4096)) until $f1.eof;
9  
-	$f1.close;
10  
-	$f2.close;
11  
-}
12  
-
13  
-=begin pod
14  
-
15  
-=head1 NAME
16  
-
17  
-File::Copy -- copy files
18  
-
19  
-=head1 SYNOPSIS
20  
-
21  
-	use File::Copy;
22  
-
23  
-	cp 'source', 'destination';
24  
-	
25  
-=head1 DESCRIPTION
26  
-
27  
-C<File::Copy> exports just one subroutine, cp taking two string
28  
-parameters: source and destination. If something comes wrong, the
29  
-internal open() or write() calls will die, C<copy()> has no special
30  
-error reporting.
31  
-
32  
-=end pod
33  
-
34  
-# vim: ft=perl6
10  t/02-file-copy.t
... ...
@@ -1,10 +0,0 @@
1  
-use v6;
2  
-use Test;
3  
-use File::Copy;
4  
-
5  
-cp 't/test.file', 't/another.file';
6  
-is slurp('t/test.file'),
7  
-   slurp('t/another.file'),
8  
-   "copied file is identical";
9  
-unlink 't/another.file';
10  
-done;
3  t/test.file
... ...
@@ -1,3 +0,0 @@
1  
-foo foo
2  
-asd
3  
-foo bar

0 notes on commit ed7310a

Please sign in to comment.
Something went wrong with that request. Please try again.