n10v / id3v2

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

"The system cannot move the file to a different disk drive" message #15

Closed highend closed 7 years ago

highend commented 7 years ago

Hi,

after compiling your example script (I get a compile error without commenting out the "comment := id3v2.CommentFrame{...}" part but I'll eventually post another issue about that...) and placing a file.mp3 in the same directory as the final .exe file I'll get this when I execute it:

id3tagger.exe Lena Stardust 2017/01/16 01:05:32 Error while saving a tag: rename C:\Users\Highend\AppData\Local\Temp\150698803 file.mp3: The system cannot move the file to a different disk drive.

This happens under Windows Server 2016 and the folder for id3tagger.exe and file.mp3 is "D:\Users\Highend\Dokumente\Go\id3tagger". The "file.mp3" doesn't get modified.

If I copy the id3tagger folder to the C:\ drive (e.g. "C:\Temp\id3tagger", I get no error message when I execute it and it modifies the .mp3 file correctly

But ofc it's necessary to be able to process files that are not on the same drive where the %TEMP% folder resides :)

So, is there a way to fix this issue?

Regards, Highend

highend commented 7 years ago

Regarding the other compilation error: It is just a misspelled word in your example script :)

    comment := id3v2.CommentFrame{
        Encoding:   id3v2.ENUTF8,
        Language:   "eng",
        Desciption: "My opinion",
        Text:       "Very good song",
    }
    tag.AddCommentFrame(comment)

If "Desciption" is changed to "Description", the example script is compiled without errors

n10v commented 7 years ago

Hm Thank you for pointing to the typo in README. Fixed that.

I try to fix issue with temp file on this week. I think, id3v2 should make temp file in same directory and then be renamed to original.

n10v commented 7 years ago

Fixed. Please test

highend commented 7 years ago

Confirmed fixed, thanks!

n10v commented 7 years ago

You're welcome!