Unfortunately I don't have direct access to my code at the moment, but the application does the following:
- Get a
string[] files = Directory.GetFiles(dir, "*.mp3", SearchOptions.AllDirectories);
- Iterate over each file in files and get a generic Tag object (not an IDV3 one specifically, or whatever the format is called)
- Build a string with a new filename {track no} - {track name} from the Tag object and add it to a list
File.Copy(files[i], newFileName, true)
to rename the file (copy to the same directory with a new name)
The File.Copy
crashes and it tells me another process is using the file. I know for a fact nothing else is using these files, but something somewhere in my code must be locking them and I don't know what, nor how to deduce which bit it is.
I've tried adding myTagObject.Save(); myTagObject.Clear(); myTagObject = null;
in case TL# was locking the file but I can't think of anything more I could do there to release it.