phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


PHP File: Retrieving File Statistic

Tag: file   Category: PHP Basic
post: 14 Apr 2008 read: 615


PHP File Tips - Part 7: If you want to retrieve statistic data from a file, you can use stat(). You can get many information such as last time access, id group, etc. Apply such as:

<?php
$f = "test.txt";

// statistic
$stat = stat($f);
print_r($stat);

?>

NumericAssociatifDescription
0 dev device number
1 ino inode number
2 mode inode protection mode
3 nlink number of links
4 uid userid of owner
5 gid groupid of owner
6 rdev device type, if inode device *
7 size size in bytes
8 atime time of last access (unix timestamp)
9 mtime time of last modification (unix timestamp)
10 ctime time of last change (unix timestamp)
11 blksize blocksize of filesystem IO *
12 blocks number of blocks allocated



Series this article:
PHP File: 3 Way of Reading File
PHP File: Reading File at Particular Lines
PHP File: Reading File at Particular Byte Ranges
PHP File: Checking File or Directory
PHP File: Showing All File in A Directory
PHP File: Showing All Files and Folders in Particular Directory
PHP File: Retrieving File Statistic
PHP File: Retrieving More File Information
PHP File: Counting Lines in a File
PHP File: Counting Characters and Words in File
PHP File: Writing File
PHP File: Locking and Unlocking File
PHP File: Removing Lines From File
PHP File: Inserting Lines into a File

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting