The Importance of Open Formats

Over at Acts of Volition, Steven Garrity continues his writing about file formats, tackling office suite formats like those used by Microsoft Word and why they are important. As you might recall, I wrote about the first post in the series, which focused on music file formats like OGG and MP3. Again, I am not going to try to explain the problems of closed formats when Garrity has already done such a good job. He concludes this post by stating, "Freedom must be on by default," meaning that programs should be able to open and save open file formats simply and easily.

Here's a personal example. Since late May, I have been looking for a program that would edit the metadata in iTunes Music Database files, which contain track information, album artwork, play counts, and a bunch of other useful information. Specifically, I would like to edit the play counts, in order to import the play counts information from my tenure in Linux and from the installation of iTunes that was on my old computer. iTunes saves music library information in two files, both called "iTunes Music Library." One of them is an XML file. It contains data like this:
<key>Track ID</key><integer>868</integer>
<key>Name</key><string>The One I Love</string>
<key>Artist</key><string>R.E.M.</string>
<key>Album</key><string>Document</string>
<key>Genre</key><string>Alternative</string>
<key>Kind</key><string>MPEG audio file</string>

The other file has an ITL extension, which marks it as an "iTunes Music Database file." It has data like this:
Syc®'ÓÞwø³«6jª7 Oâ¿×šò f "E"ìÏÂ'ãÖçiYIèØ6uÌÇr×3V_çYk(¬Ò‡É)ÜãWÝŸ(®Üi¨¼›GjŽ¤.]ßÔ‡0—PÁºõ²²;¶™ö-ø"ÃÉo ãµ3ôEL»
îV{»dÊáéCob¼|ËHÝXGÇò=ã`ÍðšÈ[YXG"©C2y5Y5H¼@‰0ýB,•(¤bNC )aGNbX ûêî

Obviously, it would be far easier for me to change the data in the XML file. Here's the kicker: while iTunes creates the XML file to make it easier to programmers of other applications to manipulate iTunes library information, the iTunes application ignores any changes in the XML file, periodically overwriting it with the contents of the ITL file. Hence, while I can view the contents of my music library in XML, I cannot modify them without reverse engineering the undocumented format of the ITL file and then creating an application that can open and save such files. If iTunes stored its information in XML, or if the ITL format was documented, an application that allowing modification of play counts would either be unnecessary (as XML can be edited in any text editor) or already created.

Comments

At 12:42 on June 20, 2005, Scot Jandly wrote:

i hear you on the itunes bit. back around april or so, my entire database file became corrupted, and as such, i had to more or less start with a fresh library (the files were fine, i just lost all the metadata like date added, play count, etc).

it sure would have been nice to have been able to restore my old play counts (useful in a bunch of my playlists) date added (somewhat trivial, but it's a good way to keep track of when you heard a certain band, etc). if i actaully used ratings, and lost those too, blood would have spilled, because there is (as far as i know) no way to recover that, unless you use a backup DB file (which was horribly out of date, but that was my fault).

At 12:49 on June 20, 2005, Martey wrote:

The worst part of the scenario is if you import an iTunes XML file back into iTunes, it will successfully import some of the information (including ratings), but not all of it (date added, date last played, and play count are all ignored for some reason).

At 1:15 on July 10, 2005, This is Martey Dodoo wrote:

Still Away


(02:38:04) Me: actually, it’s trying to get a internet connection so I

At 3:32 on July 17, 2005, blah wrote:

i have a problem with my itunes i cant access it everytime i do this message pops up and says the iTunes 4 music Library.itl file is locked on a locked disk or you do not have write permission for this file PLEASE HELP!!!!

At 3:58 on July 17, 2005, Martey wrote:

I considered deleting this comment (you want me to help you, but you do not even trust me with your real name?), but decided against it at the last minute, since it is likely that other people searching for information about ITL files could arrive here. If you are going to ask tech support questions, you should at least enter in your name and email address, and include information in your comment about the operating system you are using and the version of iTunes you have.

At 2:16 on August 5, 2005, MarteyDodoo.com wrote:

iTunes Music Library File Format

I previously wrote about my fruitless search to find the file format of iTunes Music Library files, and how I was able to use the iTunes COM Windows SDK to bypass this lack of knowledge.
If you do a search on Google for &#8220;hdfm itunes&#8220;, my ...

At 7:27 on August 24, 2005, dan wrote:

I had this exact same problem, hopefully this will help out somebody. Go to My DocumentsMy MusiciTunes and right click on the iTunes Library file, select properties. When the properties window comes up then unselect Read-Only. Do the same thing for the itunes music library file in the same location.

At 2:40 on August 31, 2005, Emma wrote:

I'm not very techically advanced when it comes to using computers, but I know there's something wrong. I had to burn some files onto a disc to free up space and I moved the entire iTunes folder, library and all onto a CD. I uninstalled most of the software and when I reinstalled it a few weeks later and plugged in the iPod, the iPod was wiped and I continuously get the error message "iTunes 4 music Library.itl file is locked on a locked disk or you do not have write permission for this file ". I've copied the iTunes 4 music library back into the My Music folder but this doesn't seem to have hepled either. I know this problem was addressed earlier on this page, but I've tried that and it still hasnt helped so I was wondering if anyone else has a suggestion? It's a Windows XP Pc, but I'm not sure what version of iTunes it is. Probably the most recent though. Please help if theres any chance you know something!

At 9:01 on August 31, 2005, Martey wrote:

I tried emailing you, Emma, but the message bounced back.

A few questions. In the comment, you said that iTunes started displaying the error after you plugged in your iPod. Does this mean that iTunes was working fine after you reinstalled it up to this point, or did plugging in your iPod automatically activated iTunes for the first time? Also, had you already copied back the iTunes folder (with the "iTunes 4 Music Library.itl" file), or did you only try that afterwards?

At 12:56 on September 11, 2005, Emma wrote:

I hadnt tried iTunes until I plugged in my iPid after reinstalling it. And I only copied back the iTunes 4 Music Library File after I found it didnt work because I assumed that the reinstallation would put everything onto the computer that had been there on the first place. You can delete my comments on this topic now though if you'd like because we got a second computer and it works fine on that, I think we may have a corrupted something on the first computer that was causing problems. Thanks anyway though!

At 10:27 on September 27, 2005, Larry D. wrote:

dan,

thanks. this worked for me. i can stop pulling what little hair i have left out.

larry

At 6:16 on January 6, 2006, Mike in Melbourne wrote:

Thanks from me too.

At 9:50 on January 8, 2006, Harry wrote:

Thanks to this question-reply chain, it is a very efficient way to solve the " iTunes 4 music Library.itl file is locked on a locked disk or you do not have write permission for this file" problem.

At 2:30 on January 9, 2006, Cisco wrote:

Thanks a lot, that helped and now it works great!

Cisco

At 8:53 on March 4, 2006, Jeff wrote:

I keep unchecking the box but it does not stay unchecked. Am i missing something? Thanks, Jeff from Omaha, NE

At 9:51 on April 18, 2006, Abhi wrote:

The information about my iTunes list is stored in iTunes Music Library.xml It stores all the path of files available i Itunes list. But what about the information about the songs that i have on my iPOD because i may not have all the songs on iPOD . What are the information stored in iTunes Library.itl file. Is there any way i can read it.

At 7:42 on April 18, 2006, Martey wrote:

Hi Abhi,

iTunes Music Library.xml and iTunes Music Library.itl store the same information, just in two different formats. iTunes only reads the ITL file, as the XML file is only for external programs to use. The information about the songs on the iPod is stored in the iTunesDB file. The easier way to access information from iTunes is through the iTunes COM SDK. If that does not work for your purposes, I did eventually find a description of the ITL file format. I never did anything with it, so your mileage might vary.

At 8:18 on May 14, 2006, Javi2008 wrote:

Thank YOU!!!

At 1:28 on May 15, 2006, Dede wrote:

Hi MarteyDodoo,

I wonder if you can help me out with a problem I've been having with iTunes recently, and can't seem to fix it with anything I find on the internet or in forums. I've recently installed iTunes on my work computer and opened it (before restarting the computer). It was working fine, but I hadn't connected my iPod yet to it. After opening and playing around with iTunes for a bit (listening to shared music) because I didn't have the USB cable to hook up my iPod to the computer, I shut down iTunes. But the last time I tried to open iTunes, I got this error message and can't figure out why: The folder 'iTunes' is on a locked disk or you do not have write permissions for this folder.

It happened exactly the same way last time (except that I had my iPod connected, and it recognized it),but after I shut down iTunes, I couldn't open it up again without this error message. I had to have ou rIT department re-image my computer (Windows 2000), in order to uninstall iTunes and get rid of the error. Unfortunately, it's come back again, and my computer was just re-imaged two days ago and I desperately want to fix it so I can listen to some music.

If you could help me out, I'd really appreciate it.

Many thanks in advance!

At 2:22 on May 16, 2006, Martey wrote:

Have you looked at the permissions on your iTunes music folder? Try deleting or renaming it and creating a new one.

At 7:40 on May 22, 2006, Simon wrote:

Thanks for that, very helpful!

At 11:52 on August 30, 2006, Shanon wrote:

THANK YOU!!!!!!!!!!! Work's great!!!!!!!!!!!!

At 8:16 on September 10, 2006, Dennis wrote:

Thanks Dan!!!...Your suggestion worked perfectly. Can't thank you enough..

Dennis