-
Notifications
You must be signed in to change notification settings - Fork 775
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
Copying with preserveTimeStamps: true is inaccurate using 32bit node #269
Comments
Ah, this could be a nasty one. Not sure how to proceed here as millisecond precision has been a bear. |
@CurryKitten Does this problem directly affect your actual code? If not, this is low-priority or wontfix IMO. |
I did a little digging previously, and this issue is due to the limitations of floating point precision in 32 bit Node.js. Internally, we implement the See here: As far as I can tell, we would need libuv to expose an alternate interface for futimes, and for node to then expose that interface to us. |
Ah, sounds like maybe the best course of action is to throw up a warning if it's 32-bit and the flag is set. |
Btw, thanks for your help here @hhamilto! |
@jprichardson How should we pass this warning? |
I generally agree with this, but I don't know of any other way other than |
OK, sounds good. Self-assigning but if someone else wants to do this, let me know. |
@jprichardson What's the most accurate way to determine 32 or 64 bit? |
Since we care about the Node.js build arch not the actual CPU arch (i.e. 32 bit Node can run on 32-bit or 64-bit arch), I think |
From the docs:
I wasn't quite sure which architectures were 32 bit. Obviously |
Great point. I was naively only thinking about @CurryKitten you were referring to |
@jprichardson I'm away on vacation at the moment, so don't have my notes with me - but I believe in this case it was just ia32 that exhibited this problem. From memory, zLinux31 was giving an issue, but it wasn't the same symptoms. |
OK, I think I'll just warn for |
I have been running the fs-extra tests via npm test on various platforms, and have been getting failures on the 32bit versions of node. I wasn't sure if millisecond precision would be supported or not at 32bits, and it should be pointed out that the underlying OS is 64bit, but we do get back valid millisecond precision timestamps using 32bit node, it's just not accurate once we copy a file and ask to preserve timestamps.
This can be reproduced using this small snippet of code -
if I then
touch
theforcopy
file and then run with 64bit nodeand then with 32bit node
I can replicate this problem on rhel7, sles12 and ubuntu 14-04
The text was updated successfully, but these errors were encountered: