Leser: 3
8 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9 10 11 12 13 14
my $flag = ".flag"; foreach my $file(@files) { if ($file !~ /$flag$/) { print "$file\n"; $edifile = $file; } my $search = "$edifile" . "$flag"; print "gesucht wird: $search\n"; if ($file =~ /$search$/) { $donefile = $file; $filehash{$edifile} = $donefile; } }
1 2 3 4
my $store_directory = "./store"; $ftp->get($edi, $edi, $store_directory) or die "Could not download $edi: $!";
1 2 3 4 5 6 7 8 9
my %hash; my $flag = ".flag"; foreach my $file(@files) { if ($file !~ /\Q$flag$/) { print "$file\n"; $hash{$file} = $file . $flag; } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
my %hash; my $flag = ".flag"; foreach my $file(@files) { if ($file !~ /\Q$flag$/) { print "$file\n"; $hash{$file} = 0; } else{ my ($short = $file) =~ s!$flag$!!; $hash{$short}++; } } %hash = map{ $_ => $_ . $flag }grep{ $hash{$_} }keys %hash;
MechaTikal+2007-10-17 16:34:35--Zweite Frage:
Code (perl): (dl )1 2 3 4my $store_directory = "./store"; $ftp->get($edi, $edi, $store_directory) or die "Could not download $edi: $!";
Da wüsst ich gern, warum die Dateien nicht im angegebenen Ordner, sondern im aktuellen Verzeichnis ankommen. Was mach ich denn da falsch?
Quoteget ( REMOTE_FILE [, LOCAL_FILE [, WHERE]] )
Get REMOTE_FILE from the server and store locally. LOCAL_FILE may be a filename or a filehandle. If not specified, the file will be stored in the current directory with the same leafname as the remote file.
If WHERE is given then the first WHERE bytes of the file will not be transferred, and the remaining bytes will be appended to the local file if it already exists.
renee+2007-10-17 17:46:00--
Wie kommst Du darauf, dass der dritte Parameter das Zielverzeichnis ist?
Aus der Doku:Quoteget ( REMOTE_FILE [, LOCAL_FILE [, WHERE]] )
Get REMOTE_FILE from the server and store locally. LOCAL_FILE may be a filename or a filehandle. If not specified, the file will be stored in the current directory with the same leafname as the remote file.
If WHERE is given then the first WHERE bytes of the file will not be transferred, and the remaining bytes will be appended to the local file if it already exists.
1 2 3 4
my $store_directory = "/store/"; $ftp->get($edi, $store_directory. $edi) or die "Could not download $edi: $!";
nepos+2007-10-18 12:16:08--Vielleicht solltest du den kompletten Pfad für dein store-Verzeichnis übergeben?
Oder liegt store wirklich im root-Dateisystem?
8 Einträge, 1 Seite |