This script uses the Net::FTP and Net::Telnet modules and moves the mpg files over to be tagged with Oracle Video server information so it can be seen. The IP's are blanked out for obvious reasons = )
#!/usr/bin/perl use Net::FTP; use Net::Telnet; $MPG_DIR = "/testpl"; opendir(MDIR, $MPG_DIR) or die "Could not open dir $MPG_DIR for readin +g: $!\n"; @files = grep(/\.mpg$/, readdir(MDIR)); closedir(MDIR); $ftp = Net::FTP->new("IP ADDRESS HERE", Debug => 9) or die "ca +n't connect: $@\n"; ##### ####Maybe try pasv connection? # $ftp->pasv(); ##### $ftp->login("user", "password") or die "coul +dn't login\n"; $ftp->cwd("/mds/nvision1") or die "could +n't change directory\n"; #$ftp->quot("bin"); $ftp->binary(); #$ftp->quot("prompt"); $ftp->quot("allo 17595824"); foreach $x ( @files ) { # Does put populate $@ with error messages? If so, inspect them: $ftp->put($x) or die "could +n't put $x: $@\n"; } $ftp->quit; # outta here $t = Net::Telnet->new => (Timeout => 2000, Prompt => '/%/', Host => $hostname ); $t->login($user, $password); foreach $x ( @files ) { print $t "vstag -E mpi /mds/nvision1/$x\n"; } $t->close; # Redundant...to keep track of all of these, just put them near the # top. #use Net::FTP; $ftp = Net::FTP->new("IP ADDRESS HERE") or die "can +'t connect: $@\n"; $ftp->login("user", "password") or die "couldn +'t login\n"; $ftp->cwd("/mds/nvision1") or die "couldn +'t change directory\n"; print $ftp "bin\n"; print $ftp "prompt\n"; foreach $x ( @files ) {($a, $b) = split(/\.[^.]+$/, $x); # Check $@ if indeed Net::FTP populates it on get failure $ftp->get($x) or die "couldn't get $filename: $@\ +n"; } $ftp->quit; # outta here

2001-03-03 Edit by Corion : Fixed <BR> tags within <CODE> tags.

Replies are listed 'Best First'.
Re: Mpg tagger
by marius (Hermit) on Feb 12, 2001 at 21:58 UTC