downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

ZipArchive::unchangeAll> <ZipArchive::statIndex
[edit] Last updated: Fri, 17 May 2013

view this page in

ZipArchive::statName

(PHP 5 >= 5.2.0, PECL zip >= 1.5.0)

ZipArchive::statNameObtener los detalles de una entrada definida por su nombre

Descripción

mixed ZipArchive::statName ( string $name [, int $flags ] )

La función obtiene información acerca de la entrada definida por su nombre.

Parámetros

name

Nombre de la entrada

flags

El argumento flags especifica cómo la búsqueda del nombre debería se hecho. También, ZIPARCHIVE::FL_UNCHANGED podría ser puesta con otros OR en él para solicitar la información acerca del fichero original en el archivo, ignorando cualquier cambio realizado.

  • ZIPARCHIVE::FL_NOCASE

  • ZIPARCHIVE::FL_NODIR

  • ZIPARCHIVE::FL_UNCHANGED

Valores devueltos

Devuelve una matríz que contenie detalles de la entrada o FALSE en caso de error.

Ejemplos

Ejemplo #1 Volcar la información estadística de una entrada

<?php
$zip 
= new ZipArchive;
$res $zip->open('test.zip');
if (
$res === TRUE) {
    
print_r($zip->statName('foobar/baz'));
    
$zip->close();
} else {
    echo 
'falló, código:' $res;
}
?>

El resultado del ejemplo sería algo similar a:

Array
(
    [name] => foobar/baz
    [index] => 3
    [crc] => 499465816
    [size] => 27
    [mtime] => 1123164748
    [comp_size] => 24
    [comp_method] => 8
)


add a note add a note User Contributed Notes ZipArchive::statName - [2 notes]
up
1
Stewart Rice
3 years ago
Since a Unix Timestamp is measured in seconds, not milliseconds, I would have to assume that mtime is 'modified time' rather than 'millisecond time'... however it does not appear to work on a Linux system
up
-1
martin_packer at uk dot ibm dot com
3 years ago
This may be stating the obvious but I assume that mtime is "millisecond time". Using http://www.onlineconversion.com/unix_time.htm  the example time "1123164748" converts to "Thu, 04 Aug 2005 14:12:28 GMT".

The two sizes - size and comp_size are presumably in bytes (the latter being the compressed file in the archive).

 
show source | credits | sitemap | contact | advertising | mirror sites