hier mal das ganze script:
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
man muss eigentlich nur ganz oben die beiden variablen ändern, dann läufts, ich habe das script einen ordner über meinen mp3s liegen
dann lösch ich alle mp3s auf dem stick und starte das prog!
[edit] der mag _ _ d a t a _ _ nicht ?! [/edit]\n\n
<!--EDIT|Netspider|1084296525-->
perl -e "s;;Ronny Lindner;;m;(..).$;;$l=$1;s;n;;g;m;.{4}$;;$_=$l;$I=$&;m;^(.);;$_.='ts';$_.=$1;$_++;$_++;$_.=$I;print ucfirst;"