-
-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stat times decimals are off #5422
Comments
I believe this is "just" a num/float vs int problem (i.e., a difference in representation of the same underlying data, not incorrect data in the rakudo/moarvm case). |
A quick test confirms it.
It's also quite a bit faster. Running |
The Problem
Decimal "stat" time values have mangled decimal portion.
Expected Behavior
The decimal portion to be exactly what the stat command kicks back.
Actual Behavior
The decimal portion is not exactly what the stat command kicks back.
Steps to Reproduce
jdv@jdv-lap:~$ cat test.raku
use nqp;
my $p = 'foo.txt'.IO;
qqx{touch $p.path()} unless $p.e;
qqx{stat $p.path()}.lines.grep(/^Mod/).say;
$p.modified.raku.say;
my $s := nqp::dispatch("boot-syscall", "file-stat", "foo.txt", 0);
my $m = nqp::dispatch(
"boot-syscall", "stat-time", $s, nqp::const::STAT_MODIFYTIME);
$m.raku.say;
jdv@jdv-lap:
$ raku test.raku$(Modify: 2023-10-15 10:56:04.952796960 -0400)
Instant.from-posix(1697381764.952796928)
1697381764.952797e0
jdv@jdv-lap:
Environment
rakudo -v
orraku -v
): v2023.08-277-g9866e7a1fThe text was updated successfully, but these errors were encountered: