nodejs / nodejs/node

fs: support utimes BigInt

未关闭
#50,859 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feature request fs never-stale
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

描述

What is the problem this feature will solve?

Current utimes FS functions have a granularity of microseconds, while the stats BigInt functionality has a granularity of nanoseconds.

What is the feature you are proposing to solve the problem?

Adding support for BigInt to the utimes functions to enable nanosecond granularity for setting timestamps.

What alternatives have you considered?

The underlying reason for this issue is that floating point second values only have 24 significant digits, which does not extend to exact nanoseconds. Having stats support BigInt u64 times, while having utimes not creates the inability to exactly set and read the same level of precision. Relying on a BigInt input as a u64 nanoseconds value seems the most sensible way to resolve this to me.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先定位 filesystem 的 utimes 函数和现有的 stats BigInt 功能。比较它们各自如何表示时间戳精度,并确定相关的平台特定路径。当 BigInt 输入能够设置纳秒级时间戳,并且这些值能够以匹配的精度读回时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
operating-systems
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。