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

Is there any API to set last modified time for a file? #1474

Closed
andrew-k-21-12 opened this issue Apr 25, 2024 · 4 comments
Closed

Is there any API to set last modified time for a file? #1474

andrew-k-21-12 opened this issue Apr 25, 2024 · 4 comments

Comments

@andrew-k-21-12
Copy link

andrew-k-21-12 commented Apr 25, 2024

Greetings!

Are there any APIs to either copy a file with all attributes (metadata) preserved or modify it for some existing file? I'm mostly interested in handling the last modified time.

If not - is it something planned to be added or it's not prioritized now?

P.S. Forgot to mention - the scope of interest is Common (not JVM, JS, Native separately).

@JakeWharton
Copy link
Collaborator

See #1466. Since this presumably only applies to the system file system and not arbitrary file systems it would make sense to be an extension.

@andrew-k-21-12
Copy link
Author

andrew-k-21-12 commented Apr 25, 2024

Just to make sure I got you correct:

  1. There is no any way to set last modified time for files in okio for common targets now.
  2. There is a plan to support features likes this by using the referenced extensions system which is being designed now.

Is everything right?

@JakeWharton
Copy link
Collaborator

Definitely 1. I'm not sure if Jesse plans on supporting this with a built-in extension or whether you'd have to write your own with regard to 2.

@swankjesse
Copy link
Collaborator

I like the idea of offering a couple extensions as a first-party optional artifact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants