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

tone tag exit gracefully after Control-C is pressed #22

Closed
rloomans opened this issue Aug 16, 2022 · 4 comments
Closed

tone tag exit gracefully after Control-C is pressed #22

rloomans opened this issue Aug 16, 2022 · 4 comments

Comments

@rloomans
Copy link

I had tone writing tags to a collection of .m4b files and I needed to interrupt it so I could get something else done.

When I pressed Control-C tone exited immediately and left the file it was writing to corrupted so that it was unrecognisable and unplayable.

Tone should either write a new file and rename into place, and/or install a signal handler to exit gracefully once it's finished writing the current file. Ideally, it should do both

@sandreas
Copy link
Owner

sandreas commented Aug 16, 2022

Thanks for sharing this... I'm sorry if it damaged your files.

Maybe this is the way to go:

@rloomans
Copy link
Author

Definitely do the graceful termination.

The other thing (that I call "rename into place" above) is where apps write a new file, close it, and then rename it over the old file. That way you either get the old file or the new file, not a corrupted mix of the two.

(My files are sitting on a NAS with filesystem snapshots... I noticed right away and could pull out an older copy)

@sandreas
Copy link
Owner

Fixed in latest code, targeted for release v0.0.9

@sandreas
Copy link
Owner

v0.0.9 has been released, feedback would be very welcome. If this happens to you again, I have to take another look.

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

2 participants