Ok all, I have a strange and potentially problematic issue.
Background: Recently upgraded to thee latest 10.5 iTunes along with OSX 10.7.2 and iOS 5 on my iPhone. My iTunes library is large - almost 300,000 songs, but have not had any issues until after the upgrade - except for the sluggishness of the progam (which apprears to be normal once you reach a certain point) as well as limitations with Genuis which I've not been able to resolve in any version. I also have a fairly elaborate Playlist setup which I've refined over the past couple of years. My iTunes library resides lookly in the default location under Music and the Media Folder sits on 3TB external. Note that everything has worked fine up until now...
Anyway, this is just a quick background - and also to set the stage for any suggestions that might involve a 'random' rebuild of the iTunes library as it would involve a massive effort.
Problem: Very intermittantly while playing music I will get an error pop up "Itunes library cannot be saved. A folder was specified instead of a file". Otherwise everything appears working - playcounts are updated and reflected in my SmartPlaylist while I pay, lyrics seem to be added as I play (via TuneText), etc - and all syncs fine with the iPhone.
Now if I shut down iTunes when this happens and try and reopen, I will get the error "The iTunes Application cannot be opened, an unknown error occured (13014)." Now if I look at the permissions of the iTunes Library database it shows "You have unknown access". Note the permissions of all other files are ok.
In the past to correct this I've pulled back an earlier version of the Library from my Time Machine which of course is not ideal. I've also set up a parallel library about a year ago which can open fine (I use this other one to stage the music before importing into my main one in that the main is too slow to edit anything major).
So far I've tried Repairing Permissions and reinstalling the iTunes.app but the intermittant problem is not resolved.