|< 1 2 3 >| | 30 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
NAME
File::Copy - Copy files or filehandles
SYNOPSIS
use File::Copy;
copy("file1","file2");
copy("Copy.pm",\*STDOUT);'
move("/dev1/fileA","/dev2/fileB");
use POSIX;
use File::Copy cp;
$n = FileHandle->new("/a/file","r");
cp($n,"x");'
1
2
3
4
5
6
7
8
9
10
11
12
--- perl-5.8.x/lib/File/Copy.pm 2003-12-05 20:43:59.000000000 +0100
+++ new.perl-5.8.x/lib/File/Copy.pm 2004-05-10 11:56:38.000000000 +0200
@@ -274,8 +274,7 @@
copy("Copy.pm",\*STDOUT);
move("/dev1/fileA","/dev2/fileB");
- use POSIX;
- use File::Copy cp;
+ use File::Copy "cp";
$n = FileHandle->new("/a/file","r");
cp($n,"x");'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use File::Copy;
use Win32API::File qw(:ALL);
use Win32::DriveInfo;
$ordner="Songs";
$stick="k:";
$type=GetDriveType($stick);
die unless $type==DRIVE_REMOVABLE;
opendir(d,"$ordner") or do { print "$!"; exit; };
@files=grep {/\.mp3$/} readdir d or do { print "$!"; exit; };
closedir(d);
##############
$free = (Win32::DriveInfo::DriveSpace($stick))[6];
$z=int(rand scalar @files);
$needed=(stat($ordner."/".$files[$z]))[7];
$kopiert=0;
while($free >= $needed)
{
$kopiert++;
print "$kopiert:\t Kopiere ".$files[$z];
copy($ordner."/".$files[$z], $stick."/".$files[$z]);
$free = (Win32::DriveInfo::DriveSpace($stick))[6];
$z=int(rand scalar @files);
$needed=(stat($ordner."/".$files[$z]))[7];
print " ".(int($free / (1024 * 1024)))."Mb frei\n";
}
print "$kopiert Dateien kopiert";
<>;
exit;
_ _ data _ _
DRIVE_UNKNOWN
DRIVE_NO_ROOT_DIR
DRIVE_REMOVABLE
DRIVE_FIXED
DRIVE_REMOTE
DRIVE_CDROM
DRIVE_RAMDISK
|< 1 2 3 >| | 30 Einträge, 3 Seiten |