in reply to Re: File::stats issue
in thread File::stats issue
i am trying to get an output similar to an "ls -l $filename" for each of the two files of each of the files in an array of filenames...#!/usr/bin/perl use File::stat; use File::Basename; $srcdir = "/nfs/spptribu/"; $dstdir = "/trib/oper/temp/sql/eventual/"; $pgmFind="/trib/oper/temp/copiaFind"; open(DATOS,"$pgmFind|"); @datos = <DATOS>; close(DATOS) ; foreach $archivo (sort @datos) { #print "datos:$archivo"; ($perm,$nol,$owner,$group,$size,$mes,$dia,$hora,$filename) = split + (/\s+/, $archivo); $namefile=basename($filename,@suffixlist); $srcfile="$srcdir$namefile"; $dstfile="$dstdir$namefile"; # printf ("Archivo: %s \n\tPermisos: %s \n\tOwner: %s \n\tGroup: %s +\n\tSize: %s \n\tMes: %s Dia: %s Hora: %s\n",$filename, $perm,$owner,$group,$size,$mes,$dia,$hora); print "origen: $srcfile\n"; print "destino: $dstfile\n"; my ($src_dev,$src_ino,$src_mode,$src_nlink,$src_uid,$src_gid,$src_rdev +,$src_size,$src_atime,$src_mtime,$src_ctime,$src_blksiz e,$src_blocks)=stat($_); my ($dst_dev,$dst_ino,$dst_mode,$dst_nlink,$dst_uid,$dst_gid,$dst_rdev +,$dst_size,$dst_atime,$dst_mtime,$dst_ctime,$dst_blksiz e,$dst_blocks)=lstat($dstfile) or die "Cagaste! destino malo"; ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$bl +ksize,$blocks)=stat('/trib/oper/scripts/planesH.s.P370' ); print "$srcfile: $src_mtime $src_size\n"; print "$dstfile: $dst_mtime $dst_size\n"; exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: File::stats issue
by moot (Chaplain) on Mar 14, 2005 at 20:32 UTC | |
by basarix (Initiate) on Mar 14, 2005 at 20:37 UTC | |
by moot (Chaplain) on Mar 14, 2005 at 20:45 UTC | |
|
Re^3: File::stats issue
by Tanktalus (Canon) on Mar 14, 2005 at 20:36 UTC | |
by basarix (Initiate) on Mar 14, 2005 at 20:44 UTC | |
by Tanktalus (Canon) on Mar 14, 2005 at 22:10 UTC | |
by basarix (Initiate) on Mar 15, 2005 at 15:15 UTC |