Skip to content
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

rt::io::fs is missing the abilty to change time metadata of files #10266

Closed
alexcrichton opened this issue Nov 4, 2013 · 3 comments
Closed
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@alexcrichton
Copy link
Member

This is one thing that I forgot to do as part of #10179. From rust you should be able to change the modification times of files (as permitted by the os). Relevant libuv calls are:

  • uv_fs_utime
  • uv_fs_futime

We should probably have a more rustic name than utime because I personally have no idea what that's implying.

@alexcrichton
Copy link
Member Author

Labeling as an easy bug, but this will require knowledge of following the existing patterns in the uv bindings and bubbling up this information to the rt::io::fs layer. This isn't a super-easy bug, but it also shouldn't be too difficult to get started on!

Right now the representation of times is just a u64, which is sad, but until we get a better choice for representing times in libstd we don't have much choice.

@jeffcutsinger
Copy link

So, uh, I went ahead and also implemented this before I realized you were working on it. Sorry I didn't mention it, I just now created a GH account. I noticed what I think is a bug in your implementation. Not sure if it's best to talk about it here or there, but the utime functions in uv are in seconds, whereas the stat function returns milliseconds. I can push up my work and reference it if you want. Otherwise, I'll grab something else.

@alexcrichton
Copy link
Member Author

Ah sorry about that! But you are indeed correct, looks like I need to shift things by a factor of 1000 in a few places, thanks for pointing that out.

Sadly I think that this is thoroughly embedded in my work right now, so it's probably best if I just go ahead with it. Sorry for not saying I was doing this either!

alexcrichton added a commit to alexcrichton/rust that referenced this issue Nov 7, 2013
This exposes the ability to change the modification and access times on a file.

Closes rust-lang#10266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants