fileinode

(PHP 4, PHP 5)

fileinodeGets file inode

說明

int fileinode ( string $filename )

Gets the file inode.

參數

filename

Path to the file.

回傳值

Returns the inode number of the file, 或者在失敗時回傳 FALSE.

範例

Example #1 Comparing the inode of a file with the current file

<?php
$filename 
'index.php';
if (
getmyinode() == fileinode($filename)) {
    echo 
'You are checking the current file.';
}
?>

錯誤/例外

失敗時拋出E_WARNING警告。

註釋

Note: 本函式的結果會被存入緩衝區。詳情參見 clearstatcache()

Tip

PHP 5.0.0 起本函式也可被某些 URL wrapper 使用。參考Supported Protocols and Wrappers 來看哪些 wrapper 支援 stat() 系列函式的功能。

參見

  • getmyinode() - Gets the inode of the current script
  • stat() - Gives information about a file

add a note add a note

User Contributed Notes 1 note

up
0
sofe2038 at gmail dot com
3 years ago
As documented in https://www.php.net/manual/en/function.stat.php#refsect1-function.stat-returnvalues:
> On Windows, as of PHP 7.4.0, this is the identifier associated with the file, which is a 64-bit unsigned integer, so may overflow. Previously, it was always 0.

It appears that fileinode shares the same underlying implementation.
To Top