Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP lstat() Function

PHP lstat() Function


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual


Definition and Usage

The lstat() function returns information about a file or symbolic link.

This function returns an array containing the following elements:

Syntax

lstat(file)

Parameters Description
file Required. Specifies the path to check.

Tips and Notes

**Note:** The results returned by this function differ from server to server. This array contains numeric indices, named indices, or both.

**Note:** The results of this function are cached. Use clearstatcache() to clear the cache.

**Tip:** lstat() is roughly similar to stat(). The only difference is that if the file parameter is a symbolic link, the status of the symbolic link is returned (rather than the status of the file the link points to).


Example

The code above will output:

Array

(

[0] => 0

[1] => 0

[2] => 33206

[3] => 1

[4] => 0

[5] => 0

[6] => 0

[7] => 92

[8] => 1141633430

[9] => 1141298003

[10] => 1138609592

[11] => -1

[12] => -1

[dev] => 0

[ino] => 0

[mode] => 33206

[nlink] => 1

[uid] => 0

[gid] => 0

[rdev] => 0

[size] => 92

[atime] => 1141633430

[mtime] => 1141298003

[ctime] => 1138609592

[blksize] => -1

[blocks] => -1

)


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual