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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -