[php-src] Issue #11946: `stat` only provide timestamp down to second instead of nanosecond

From: Date: Sat, 12 Aug 2023 14:28:06 +0000
Subject: [php-src] Issue #11946: `stat` only provide timestamp down to second instead of nanosecond
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245161@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11946 Author: kocoten1992 ### Description Hi maintainer, stat in php only provide presicion down to second, but it could be down to nanosecond. ``` File: abc.xyz Size: 0 Blocks: 0 IO Block: 4096 regular empty file Device: 8,2 Inode: 6160531 Links: 1 Access: (0664/-rw-rw-r--) Uid: ( 0/root) Gid: ( 0/root) Access: 2023-08-12 09:10:14.152726478 +0700 Modify: 2023-08-12 09:10:14.152726478 +0700 Change: 2023-08-12 09:10:14.152726478 +0700 Birth: 2023-08-12 09:10:14.152726478 +0700 ``` ``` [ ..., "atime" => 1691806214, "mtime" => 1691806214, "ctime" => 1691806214, ... ] ``` I'm aware that https://linux.die.net/man/2/stat does explain it Since kernel 2.5.48, the stat structure supports nanosecond resolution for the three file timestamp fields.. I was running into this problem today, run test need to ensure directory was created within 1s, which cannot be done if read from php stat.

« previous php.bugs (#245161) next »