You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can set the last-modified timestamp on a file via a simple NIOFileSystem API.
Actual behavior
No APIs exist to set timestamps on files or perform a simple "touch".
I am not sure how much control over the various file timestamps one would realistically need, but I find that setting the current time as last-modified is a common thing on server systems.
My concrete use case was a tiny service that periodically checks local certificate files (for TLS), renews them if required, and triggers a "config-reload" of a long-running traefik instance. The simplest (maybe only?) way to tell traefik to hot-reload its certificates is by touching the config file.
I ended up sys-calling into utime myself, but it would be a great fit for the NIOFileSystem APIs.
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue, I think this is a reasonable API to add.
We likely want to add a new API to the WritableFileHandleProtocol which can be used to update the access and modification time of an open file. Under the hood this would use futimens.
From that base API we can then extend WritableFileHandleProtocol to have a 'touch' API which sets both access and modification times to the current time.
Expected behavior
I can set the last-modified timestamp on a file via a simple
NIOFileSystem
API.Actual behavior
No APIs exist to set timestamps on files or perform a simple "touch".
I am not sure how much control over the various file timestamps one would realistically need, but I find that setting the current time as last-modified is a common thing on server systems.
My concrete use case was a tiny service that periodically checks local certificate files (for TLS), renews them if required, and triggers a "config-reload" of a long-running traefik instance. The simplest (maybe only?) way to tell traefik to hot-reload its certificates is by touching the config file.
I ended up sys-calling into
utime
myself, but it would be a great fit for the NIOFileSystem APIs.The text was updated successfully, but these errors were encountered: