package FileInfo; use File::stat; use User::grent; use User::pwent; use POSIX qw(strftime); sub ObtenerInfoArchivo { my %Datos = (); my $st = stat(shift @_) or die "No se pudo abrir archivo"; my $ActTime = strftime "%a %d/%m/%y %H:%M:%S", localtime($st->atime); my $ModTime = strftime "%a %d/%m/%y %H:%M:%S", localtime($st->mtime); my $CreTime = strftime "%a %d/%m/%y %H:%M:%S", localtime($st->ctime); my $grupo = getgrgid($st->gid); my $ident = getpwuid($st->uid); $Datos{UNAME} = $ident->[0]; $Datos{UID} = $st->uid; $Datos{GNAME} = $grupo->[0]; $Datos{GID} = $st->gid; $Datos{ATIME} = $ActTime; $Datos{MTIME} = $ModTime; $Datos{CTIME} = $CreTime; return \%Datos; } 1;