Closed rdlowrey closed 10 years ago
This PR adds two new constants:
UV::S_IFDIR
UV::S_IFREG
These constants allow differentiation between regular files (S_IFREG) and directories (S_IFDIR) when used for bitwise AND operations against the "mode" value returned from uv_fs_stat/fstat/lstat().
"mode"
uv_fs_stat/fstat/lstat()
Example:
<?php uv_fs_open(uv_default_loop(), __FILE__, UV::O_RDONLY, 0, function($r){ uv_fs_fstat(uv_default_loop(), $r, function($result, $da) { echo "is directory: ", ($da['mode'] & UV::S_IFDIR ? 'yes' : 'no'), "\n"; echo "is file: ", ($da['mode'] & UV::S_IFREG ? 'yes' : 'no'), "\n"; }); }); uv_run();
Thanks for the quick merge :)
:)
This PR adds two new constants:
UV::S_IFDIR
UV::S_IFREG
These constants allow differentiation between regular files (S_IFREG) and directories (S_IFDIR) when used for bitwise AND operations against the
"mode"
value returned fromuv_fs_stat/fstat/lstat()
.Example: