n10v / id3v2

🎵 ID3 decoding and encoding library for Go
https://pkg.go.dev/github.com/bogem/id3v2/v2
MIT License
340 stars 52 forks source link

Temp file gets created, and if issue occurs, never gets cleaned up #9

Closed gabek closed 8 years ago

gabek commented 8 years ago

I just noticed a bunch of random files in /tmp. They had randomly generated names so I couldn't tell what they were from. Digging deeper I found they were audio files, but I didn't know how they got there.

Looking through the different possibilities I came upon https://github.com/bogem/id3v2/blob/master/tag.go#L225. It seems to make sense. I've seen some tagging errors happen over time, and my guess is each time I have an error tagging with id3v2 it leaves that temp file.

Would this be the case?

n10v commented 8 years ago

Good issue. I forgot, what if issue occurs in Save method, temp files will be never cleaned up. So yes, this is why you have a lot of temp files in /tmp directory