in reply to Re^4: Socket or not
in thread Socket or not
Nice idea++ Though I think that calculating and re-calculating an MD5 until you get a match might be rather expensive.
A cheaper alternative would be to append the length of the file: filename.ext.123456. That way, a simple -s of the file will tell if it has been fully transferred.
That would make the monitoring script very simple. All that would be needed is something like:
#! perl -slw use strict; my $sharePath = '...'; while( 1 ) { for( glob $sharePath . "IN/*" ) { my( $filename, $expected ) = m[/([^/]+)\.(\d+)$]; if( $expected == -s ) { rename $_, "$sharePath/$filename"; system 1, qq[theProcessingScript.pl <$sharePath/$filename >$sharePath/OUT/$file +name]; } } sleep 1; }
|
|---|