Leser: 1
|< 1 2 >| | 12 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
#!/usr/bin/perl -X
use strict;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
my $files;
my @filename;
opendir(DIR, "$path");
for $files (grep {/.bz2/} readdir DIR){
push(@filename, $files);
}
****************************************
* HIER SOLLTE UMBENNENUNG STATTFINDEN *
****************************************
my $dir = '$path';
my $zipfile = '$neurDateiname';
my $zip = Archive::Zip->new();
chdir $dir or die "Cannot chdir $dir:$!\n";
die "Error reading $zipfile:$!" unless $zip->read( "$dir/$zipfile" )
== AZ_OK;
$zip->extractTree();
Quote[admin@doorgunner ~]$ bzip2 test.txt
[admin@doorgunner ~]$ mv test.txt.bz2 test.txt.zip
[admin@doorgunner ~]$ unzip test.txt.zip
Archive: test.txt.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of test.txt.zip or
test.txt.zip.zip, and cannot find test.txt.zip.ZIP, period.
[admin@doorgunner ~]$
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
#!/usr/bin/perl -w
use strict;
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
my $files;
my @filename;
my $newname;
opendir(DIR, "H:/pmi_daten/pmi/aix0021a");
for $files (grep {/.bz2/} readdir DIR){
push(@filename, $files);
}
my $x=0;
foreach(@filename){
$files = "bzip2 -d H:/pmi_daten/pmi/aix0021a/" . "$_";
system($files);
}
1 2 3 4 5 6 7 8 9
use File::Spec; my @args = ('bzip2', '-d'); my @paths = ('H:','pmi_daten','pmi','aix0021a'); foreach(@filename){ my $path = File::Spec->catfile( @paths, $_); system(@args,$path); }
|< 1 2 >| | 12 Einträge, 2 Seiten |