in reply to Re: read copy and moving files
in thread read copy and moving files
#!/usr/local/bin/perl use strict; use diagnostics; my $DIR_A = "/u/web/smpsvc/bulletin"; my $DIR_B = "/u/web/smpsvc/espanol/bulletin"; opendir DIR, "$DIR_A"; while(defined(my $item = readdir DIR)){ open FILE,"$DIR_A/$item" or warn "$!", next; open COPY,"COPIES/$item" or warn "$!", next; while (read FILE,my $buffer,4096){ print COPY $buffer; } close FILE; close COPY; exec("mv","$DIR_A/$item","$DIR_B/$item"); # performes an mv comman +d like on the command line } closedir DIR;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: read copy and moving files
by nothingmuch (Priest) on Oct 16, 2002 at 22:12 UTC | |
by softworkz (Monk) on Oct 17, 2002 at 15:12 UTC |