Shows the OS statistics and information about OS.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of illustration. * * * * Please direct all inquiries to saqib at mycplus.com * *******************************************************/ <html> <head> <title>lstat</title> </head> <body> <? /* ** print stat information based on OS */ // get stat information $statInfo = lstat("data.txt"); if(eregi("windows", $OS)) { // print useful information for Windows printf("Drive: %c <br />\n", ($statInfo[0]+65)); printf("Mode: %o <br />\n", $statInfo[2]); print("Links: $statInfo[3] <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("Created: %s <br />\n", date("H:i:s F d, Y", $statInfo[10])); } else { // print UNIX version print("Device: $statInfo[0] <br />\n"); print("INode: $statInfo[1] <br />\n"); printf("Mode: %o <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: %s <br />\n", date("H:i:s F d, Y", $statInfo[10])); print("Block Size: $statInfo[11] <br />\n"); print("Blocks: $statInfo[12] <br />\n"); } ?> </body> </html> |