Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iTunes 10 Keeps Creating Temp File.tmp Files

I am using iTunes 10.6.1 (7) on Lion 10.7.4 and I have (yet again) noticed that iTunes has started creating multiple copies of Temp File.tmp in the iTunes folder.


It creates a copy every single time I do anything inside iTunes, including skipping a track or checking the iTune store. I thought that maybe my ClamXav Sentry scanner was causing issues so I removed the iTune directory from the scan and even shut it down alltogether. I have not shared my iTunes library either so I can se no reason that anything else is holding onto this file and causing iTunes to create a copy of the iTunes Music Library.xml file.


A disk repair has also not helped.


I have searched everywhere within the forums and via Google and can find no solution or explanation.


Its simple starts at some random time and they stops just as randomly. However this time is particularly bad as EVERYTHING I do inside iTunes caused the problem.


Any help or guidance greatly appreciated.


Regards


NIALL8-(

MacBook Pro, Mac OS X (10.7.4)

Posted on May 15, 2012 12:18 PM

Reply
Question marked as Best reply

Posted on May 15, 2012 12:44 PM

Its just possible I may have resolved the issue but it took some tinkering and is not for the faint hearted.


I tried to delete the iTunes Music Library.xml file in order to try and recreate it and I got a -8072 error. I looked at the info for the file and noticed that the rights to the file could not be determined.


I checked my rights to the Temp file.tmp file and I had the correct read/write ones. So I wondered if permissions were an issue hence iTunes recreating the file everytime.


Having given my admin account the necessary access I used terminal to delete the original iTune Music Library.xml file and then renamed the .tmp file to be the correct iTunes Music Library.xml one. They were the same size.


I then logged back in with my normal non admin account and checked the rights I had to the file were still correct and they were.


Now when I doing anything in iTunes the tmp files are created and then disappear as expected and I am left with the correct iTunes Music Library.xml file with the correct rights.


I hope this has resolved my issue and will continue to monitor and report back if necessary.


I also hope that this 'fix' may work for others and stay fixed!

70 replies

May 24, 2013 7:38 AM in response to Niall Mallyon

I am 100% sure the issue (initially) has nothing to do with any anti-virus scanner. I am also 100% sure Siddhi67 has located the origin of the issue: the local backup of Time Machine. The reason that I am sure is simple: I have never installed any anti-virus software and I can reproduce (start and stop) the creation of temp-files by turning the local back-up of Time Machine on and of (using Mountain Tweaks btw). It might be that a virus scanner also 'does' something with this local Time Machine back-up setting, but I am sure Time Machine is causing the issue.

May 27, 2013 9:59 AM in response to Niall Mallyon

Hi again,


So, I've been fiddling around this afternoon and I appear to have fixed the problem - for me at least - not saying that this will work for everyone.


First I quit iTunes.


Then I deleted all the temp files in the iTunes folder.


Then I performed a Time Machine back up.


Next I went to my Music folder and entered Time Machine. I went back to the back up I had just performed, selected the iTunes folder and clicked restore. This took a while because I have a lot of music...!


I opened up iTunes (this also took a while as it had to check the 'new' library) hey presto, everything was working fine, no more temp files were being created and there was no more weird iTunes Music Library.xml file.


If you do want to attempt this, please be very careful. Make sure you are restoring your most recent version - so don't make any changes (adding or editing music) in between the back up and the restore.


Also you will need a lot of hard drive space (depending on the amount of music you have) because, as your hard drive wipes one version of the library with the other, it will technically make room for two libraries.


So, like I said it worked for me! It might not work for you. Please don't blame me if it doesn't! And, like I said, be very careful when you're restoring! And check and double check that your external hard drive/Time Machine is working properly. I don't want to be blamed if someone accidentally wipes their entire music library!


In summary - for me at least - it appeared that this strange .xml file was the cause of the problem. For whatever reason Time Machine wasn't backing this file up so doing a restore from there fixed the problem for me.

May 28, 2013 11:52 AM in response to Wax Cat

Wax Cat...you may have had an old file laying around there. OSX now names that iTunes file iTunes Library.xml. And is definitely needed within iTunes for other programs to access iTunes.


I wanted to post again and say that Siddhi67's solution has worked 100% for me. Anti-virus programs and old files can also mess things up. But it seems that the .tmp files are created because iTunes is not able to update either the iTunes Library.itl or the iTunes Library.xml files (or both). So the temp files are saved and left in the iTunes folder.


Good luck. If anybody else has found a permanent solution (for you) let us know. This has been a real headache for me and I'm thankful for not having my hard drive fill up with these temp files any more!

May 28, 2013 11:55 AM in response to broob

Hey there, yes I definitely still have the iTunes Library.xml file. The problem was that I had that file as well as the iTunes Music Library.xml file. In my case it definitely appeared that some kind of conflict between these files was causing the problem. Once I got rid of this file by over-writing my iTunes folder I stopped generating temp files...


Everything is working smoothly now, no probs at all.

May 29, 2013 10:57 AM in response to Niall Mallyon

Hey guys,


After many months of problem free. I found a solution that works for me.


1- I deleated all the temp files created by iTunes.


2- I use a option that at first I had very little hope on it.

In iTunes : File / Library / Organize Library


3- In that window I check the box of Reorganized files in the folder ''Music Library''


And I let iTunes do the work.


It's seems too simple but it worked for me.


My understanding of the problem after all the research is that problem can occure when:


1- You have a massive library

2- You've been updating iTunes for a long time. My library was originaly created in 2007. So everytime iTunes was was doing an major update it was updating the library as well. Which maked sense. But when I was looking at my file strcture in the finder it was organized the ''old way''. After a while problem starts to appear just like an old house.


So that fonction was put in place to update this issue.


My advice for those who have a massive ''old'' iTunes.


MAKE SURE YOUR iTUNES IS TIDY!


Keep your iTunes Media folder organized

Copy files to iTunes Media folder when adding to library.


If needed consolidate files if they are not all at the same place.


This is the more simple solution I find.


The other solution which is extream and painful is to restart your library from scratch.

Keep your media some where and delete all your iTunes and restart from scratch a re import all media.


By chance the first solution worked for me.


Niall Mallyon try this if you have not tried it yet and let me know the result.


Please feel free to ask questions.


This is a case close for me after 11 months of pain...


(on a first world problem)

May 31, 2013 11:34 AM in response to Mr Blond Qc

Hi,

Thanks for the information.

My library is already 'organised' in this way anyway in that I have that option set in the iTunes Advanced preferences.

For completeness however I unticked the option then reticked and let iTunes do its thing even though in reality nothing was actually changed in terms of my library organisation.

Will monitor and report back as necessary. May be some time though as my last 'fix' (restoring the xml from backup) lasted nearly 4 months.

Kind Regards.

iTunes 10 Keeps Creating Temp File.tmp Files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.