Source: lesson_12_g_lstat.php | Résultat |
<?php $statInfo = lstat("renard.txt"); if (isset($HTTP_SERVER_VARS['OS'])) { if(eregi("windows", $HTTP_SERVER_VARS['OS'])) { // Windows printf("Disque: %c <br/>", ($statInfo[0]+65)); printf("Mode: %o <br/>", $statInfo[2]); print("Liens: $statInfo[3] <br/>"); print("Taille: $statInfo[7] bytes<br/>"); printf("Dernier accès: %s <br/>", date("H:i:s F d, Y", $statInfo[8])); printf("Dernière modification: %s <br/>", date("H:i:s F d, Y", $statInfo[9])); printf("Créé: %s <br/>", date("H:i:s F d, Y", $statInfo[10])); } else { // UNIX/LINUX print("Device: $statInfo[0] <br/>\n"); print("INode: $statInfo[1] <br/>\n"); printf("Mode: °?oo <br/>\n", $statInfo[2]); print("Links: $statInfo[3] <br/>\n"); print("UID: $statInfo[4] <br/>\n"); print("GID: $statInfo[5] <br/>\n"); print("Device Type: $statInfo[6] <br/>\n"); print("Size: $statInfo[7] bytes<br/>\n"); printf("Last Accessed: %s <br/>\n", date("H:i:s F d, Y", $statInfo[8])); printf("Last Modified: %s <br/>\n", date("H:i:s F d, Y", $statInfo[9])); printf("Last Changed: '?os <br/>\n", date("H:i:s F d, Y", $statInfo[10])); print("Block Size: $statInfo[11] <br/>\n"); print("Blocks: $statInfo[12] <br/>\n"); } } else echo "Le serveur ne semble pas disposer de HTTP_SERVER_VARS['OS'] <br/>";
?>
| Le serveur ne semble pas disposer de
HTTP_SERVER_VARS['OS']
|