Thread Ordnervergleich SFTP Upload (7 answers)
Opened by Azmodia at 2015-07-09 10:35

GwenDragon
 2015-07-09 12:34
#181514 #181514
User since
2005-01-17
14747 Artikel
Admin1
[Homepage]
user image
Einfach verständliche Weise:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;

use 5.010;
use File::Basename;

my $input_dir    = '/data/input/';
my $transfer_dir = '/data/transfer/';

my %nicht_transferiert;

for my $f ( glob "$input_dir/*" ) {
    my $fn = fileparse( $f );
    $nicht_transferiert{$fn} = 1;
}
for my $f ( glob "$transfer_dir/*" ) {
    my $fn = fileparse( $f );
    $nicht_transferiert{$fn} = 0;
}

my @zu_transferierende_dateien
  = grep { $nicht_transferiert{$_} == 1 } sort keys %nicht_transferiert;


Editiert von GwenDragon: fileparse korrigiert
Last edited: 2015-07-10 11:13:22 +0200 (CEST)

View full thread Ordnervergleich SFTP Upload