"File Cannot Be Opened For Writing"

Thinking that other folks may encounter this -- yet another variant on "locked for writing" that has NOTHING to do with mp3 file integrity, disallowed characters in a tag, or file permissions -- PATH LENGTH. I've encountered the dreaded "file locked" error multiple times.

Following advice here: How to check files for errors? I tried checking the mp3 files with both foobar2000 and mp3diags. Nothing doing, mp3tag still said the file was locked.

I then modified the mp3 file itself by:

  • Converting to WAV
  • Run ClickRepair on WAV, saved to -cr.wav
  • Convert to Flac (to avoid second lossy mp3 file)

mp3tag STILL says file is locked. Whatever "it" is, it's not the audio file.

I bought some recordings of Wagner's Ring cycle from OperaDepot. He creates a folder structure like this:

AlbumName/OperaName/DiscID/DiscNumber/Files

with both AlbumName and OperaName including performers, e.g.,

Wagner - RotN - Böhm - Bayreuth - 1968/Die Götterdämmerung - Nilsson, Windgassen, Treptow, Stewart/10011/Die Götterdämmerung - 1/filename.mp3

That's a long filepath. On a hunch, I removed the OperaName/DiscID parts of that path by moving all of the DiscNumber folders up two levels.

mp3tag no longer says the files are locked!! The move shortened the filepath considerably. I thus conclude that filepath length was actually the issue and the "locked" error is itself erroneous. I think mp3tag is encountering a error condition it is not programmed to recognize, so in this case it's throwing the "locked" error which is misleading.