Leser: 1
|< 1 2 >| | 17 Einträge, 2 Seiten |
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
46
47
48
49
50
51
52
53
54
55
56
57
#!c:\Perl\bin\perl.exe
use warnings;
print "Content-type: text/html\n\n";
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">', "\n";print "<html>\n";
print "\n\n";
print "<html>\n";
print "\n";
print "<head>\n";
print "<title>TEST MODULE ARCHIVE::ZIP</title>\n";
print "</head>\n";
print "<body aLink=\"\#000000\" bgColor=\"\#F0F2FF\" bottomMargin=\"0\" leftMargin=\"0\" link=\"\#000000\"\n";
print "rightMargin=\"0\">\n";
print " Test 1 zum erzeugen von Zip-Files !\n";
use Archive::Zip;
my $pfad = "C:\xampp\htdocs\keys";
chdir $pfad or die "chdir nach '$pfad' nicht moeglich: $!";
my $zip = Archive::Zip->new();
$zip->addFile("C:\xampp\htdocs\cgi-bin\newuser.pl");
$zip->addfile("C:\xampp\htdocs\cgi-bin\edituser.pl");
my @Dateien;
find( sub {push @Dateien, $File::Find::name},"./Check/" );
for (@Dateien) {
if (-d) {
$zip->addDirectory($_);
}
else {
$zip->addFile($_);
}
}
my $zipname = 'check_V';
{
open CHECK, './Check/Check.pm' or die "Kann './Check/Check.pm' nicht oeffnen: $!";
my @checkinhalt = <CHECK>;
close CHECK or die "Kann './Check/Check.pm' nicht schliessen: $!";
(my $v) = grep s~^\s+\$Version\s*=\s*'([.\d]+[a-z]?)'\s*;\s*$~$1~, @checkinhalt;
$zipname .= $v;
}
$zipname .= '.zip';
$zip->writeToFileNamed($zipname);
print " Variablentest\n";
print "\n";
print "</body>\n";
print "</html>\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
my $zip = Archive::Zip->new();
chdir $log_dest or die "chdir $log_dest: $!";
opendir(DIR,$log_dest) or die "Can't open the current Directory: $!\n";
my @names = readdir(DIR) or die "Unable to read current dir:$!\n";
foreach my $fileName (@names) {
if ($fileName =~ /.LOG/) {
$zip->addFile($fileName);
}
}
my $zip_name = "$Short$srv$zeit_str.zip";
print "\nZipping Files to $zip_name\n\n";
$zip->writeToFileNamed("$zip_name");
1
2
3
4
my $zip = Archive::Zip->new();
$zip->addFile("C:\xampp\htdocs\cgi-bin\newuser.pl");
$zip->addfile("C:\xampp\htdocs\cgi-bin\edituser.pl");
1
2
3
4
5
my $zip = Archive::Zip->new() or die $!;
[...]
$zip->addFile('C:\xampp\htdocs\cgi-bin\newuser.pl') or die $!;
[...]
$zip->writeToFileNamed($zip_name) or die $!;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use Archive::Zip;
use strict;
my $log_dest = "C:\\TEMP\\ZIP";
my $zip = Archive::Zip->new();
chdir $log_dest or die "chdir $log_dest: $!";
opendir(DIR,$log_dest) or die "Can't open the current Directory: $!\n";
my @names = readdir(DIR) or die "Unable to read current dir:$!\n";
foreach my $fileName (@names) {
if ($fileName =~ /.LOG/) {
$zip->addFile($fileName);
}
}
my $zip_name = "test.zip";
print "\nZipping Files to $zip_name\n\n";
$zip->writeToFileNamed("$zip_name");
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
#!c:\Perl\bin\perl.exe
use warnings;
use Archive::Zip;
print "Content-type: text/html\n\n";
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">', "\n";print "<html>\n";
print "\n\n";
print "<html>\n";
print "\n";
print "<head>\n";
print "<title>TEST MODULE ARCHIVE::ZIP</title>\n";
print "</head>\n";
print "<body aLink=\"\#000000\" bgColor=\"\#F0F2FF\" bottomMargin=\"0\" leftMargin=\"0\" link=\"\#000000\"\n";
print "rightMargin=\"0\">\n";
print " Test 5 zum erzeugen von Zip-Files $filename!\n";
my $log_dest = "c:\\TEMP\\ZIP";
my $zip = Archive::Zip->new();
chdir $log_dest or die "chdir $log_dest: $!";
opendir(DIR,$log_dest) or die "Can´t open the current Directory: $!\n";
my @names = readdir(DIR) or die "unable to read the current dir:$!\n";
foreach my $filename (@names) {
if ($filename =~ /.LOG/) {
$zip->addFile($fileName);
}
}
my $zip_name = "test.zip";
print "\nZipping Files to $zip_name\n\n";
$zip->writeToFileNamed("$zip_name");
print "\n";
print "</body>\n";
print "</html>\n";
|< 1 2 >| | 17 Einträge, 2 Seiten |