#!/usr/bin/perl use Env qw($windir); if( $windir eq "" ) { print "Using UNIX command line options.\n"; } else { print "Uinsg Windows command line options.\n"; } $some_dir = "Output/"; opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!"; while( $infile = readdir(DIR) ) { if( !grep( /^\./, $infile ) && !grep( /^CVS/, $infile ) ) { print "Copying files from "; print $infile; if( grep( /^lib/, $infile ) ) { $outfile = "../../lib/strings"; } else { $outfile = "../../features/" . $infile . "/strings"; } print " to " . $outfile . "\n"; if( $windir eq "" ) { # Unix $cmd = "cp Output/$infile/* $outfile"; } else { # Windows $infile =~ s/\//\\/g; $outfile =~ s/\//\\/g; $cmd = "copy Output\\$infile\\* $outfile"; } system( $cmd ); } } closedir DIR;