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

Option to preserve file mtime on save #645

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kjc1
Copy link

@kjc1 kjc1 commented Apr 2, 2024

Provides support to all file formats to preserve the original file mtime on save. I'm aware some users already implement this functionality outside of Mutagen (e.g. Picard) so this has been implemented as an optional flag on the save method where the default (false) maintains the current behaviour.

I have a separate PR incoming to utilise this in Quod Libet.

@lazka
Copy link
Member

lazka commented Jun 30, 2024

What's the use case for this? Any why does it have to be part of mutagen?

@phw
Copy link
Collaborator

phw commented Jun 30, 2024

I also think this should be part of an application using mutagen, not mutagen itself. Mutagen should stick to the low level functionality.

I see several issues here

  • Even if mutagen does this it might not be sufficient for applications, as they might do additional changes to the files and hence need to implement the timestamp reset anyway
  • The implementation does not work reliably in all cases. E.g. we learned in Picard that resetting the timestamp after writing does not work reliable when writing to SMB shares on Windows. There is some asynchronicity when writing files that lead to a race condition and the timestamp still being changed by the OS after the reset happened. I don't think situations like this are to be solved by a library handling metadata tags.

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

Successfully merging this pull request may close these issues.

3 participants