How to determine whether a file has hard links in php -
i want number of linked hard-links of file in php (same result in ls -l )
example :
ls -l file1 -rw-rw-r--. 1 lilo lilo 0 feb 26 07:08 file1 ^ how can data?
thank in advance.
use stat() function:
<?php $filestat = stat('/path/to/file'); echo 'number of links file: '.$filestat['nlink']; ?> a list of array members stat() retrieves can found in the manual.
Comments
Post a Comment