Cannot Create File In Library Directory In A Mac

Upgrade your iTunes library in macOS Catalina

When you open the Apple Music app or Apple TV app for the first time in macOS Catalina, your iTunes library is upgraded so you can use it with the new apps. If you have multiple iTunes libraries, you need to upgrade each library before you can use and switch between them in macOS Catalina.

Switch to another iTunes library

  1. Hold down the Option key, then open the Music app or Apple TV app.
  2. In the window that appears, click Choose Library.
  3. Select a library, then click Choose.

With the release of Mac OS X Lion way back in 2011, Apple removed easy access to the user’s Library folder. Although arguably well-intentioned, this change was frustrating for longtime Mac power.

Learn more about what happens when you upgrade another iTunes library.

78 64 likes 136,062 views Last modified Jan 15, 2020 6:38 PM

The steps given below should help if your iTunes library is empty, missing content, or you get the error 'The file iTunes Library.itl cannot be read because it was created by a newer version of iTunes.' even though you haven't downgraded iTunes.


(If you have downgraded then use these steps but choose, if needed, an older backup file that corresponds to the build you are reverting to.)


Note that in iTunes 11 or later an 'empty' library may show your past purchases with cloud links to stream or download them.


macOS 10.15 Catalina

If you're missing expected content in the Music or TV apps after upgrading to Catalina try holding down option as you start either app and browse to the location of your previous iTunes Library to attempt the upgrade again. You may need to delete the file ~/Music/Music/Music Library first. If there is no change you can try importing the iTunes Music Library.XML file should it exist.



Restore an older version of your library database

The following steps are similar in part to those given in the support document HT203225: If you don't see your entire library after you update iTunes on your Mac or PC.


Cannot Create File In Library Directory In A Mac Download

In the Previous iTunes Libraries folder (inside your main iTunes library folder) there should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library as iTunes Library (Corrupt) and then rename the restored file as iTunes Library. Start iTunes. iTunes should now show all your content, bar any recent additions to or deletions from your library.


If you have a backup of your iTunes Library on another drive or a service like Time Machine then that may hold a more up to date version of the iTunes Library.itl file that you can restore, but otherwise the process is the same.



The .itl file extensions may be hidden. If so don't add one when renaming files.

Cannot create file in library directory in a mac pdf



Additional steps for iCloud Music Library users

Optional, use if content has been removed from iCloud Music Library in error

If you have access to iCloud Music Library as part of an Apple Music or iTunes Match subscription disconnect from the Internet before restoring the old database, turn iCloud Music Library off, then close iTunes, reconnect to the Internet, open iTunes and turn iCloud Music Library back on again. The restored offline library should then be merged with what is in the cloud. These options can be found under Edit > Preferences > General (Windows) or iTunes > Preferences > General (Mac OS X).



Note that you cannot simply double-click on the various files in the Previous iTunes Libraries folder to see what they contain. Doing so will start iTunes, but not change the library file that it opens. Either place the file that you want iTunes to open at the correct path, or hold down shift (option on a Mac) when starting iTunes and choose an alternate library file. See HT201596: Open a different iTunes Library file or create a new one for more details. In general you want your active library file to be in the main iTunes folder so file manipulation is usually the correct solution.



Cannot Create File In Library Directory In A Mac Free

Alternatively, depending on exactly when and why the library went missing, there may be a recent .tmp file in the main iTunes folder that can be renamed as iTunes Library.itl to restore the library to a previous state. These files may be hidden so look up how to reveal hidden & system files on your particular version of your operating system. Make sure to use one comparable in size to those in the Previous iTunes Libraries folder. Certain third party software has been known to cause this issue from time to time, in particular some antivirus applications and Sony VAIO Entertainment Platform. See HT203288: iTunes creates an empty library file in Windows for details (retired document, archived version). In macOS 10.15 Catalina the Music Library.musiclibrary file is a package that contains equivalents for the library files that would previously have been in the iTunes folder. Internally there is a file called Library.musicdb, which would appear to be the real analog to the .itl file. Music creates Temp File.tmp files within the .musiclibrary package when updating the library, so it is possible that in a corrupted library there will be a .tmp file that can be restored if you right click on Music Library.musiclibrary and Show Package Contents.



When the backup has been restored you can use File > Add folder to Library and choose the iTunes Media folder to add in any new media added since the backup was made, or use iTunes Folder Watch (Windows) with its option to check for dead tracks on startup for a tool that can also remove deleted items, or fix some metadata when an item has been moved.



If your library is in a non-standard location another possibility is that the preference file that records which .itl file to open has been reset or corrupted. This may cause iTunes to open or create a library at the standard path of <User's Music>iTunes. In this event, press and hold down shift as you launch iTunes to reconnect to the correct library file.

Cannot Create File In Library Directory In A Mac Address


In a similar vein it is possible that a corrupt preference file may cause iTunes to fail at launch with one of these errors:

  • The file iTunes Library.itl cannot be read because it was created by a newer version of iTunes.
  • The folder “iTunes” is on a locked disk or you do not have write permissions for this folder.
  • The iTunes Library.itl cannot be found or created. The default location for this file is in the 'iTunes' folder in the 'Music' folder.

It may be worth trying the shift-start-iTunes method (option on a Mac) to actively select the .itl file that should contain your library. If you still get the error message try Repair security permissions for iTunes for Windows and/or check for interference from anti-virus software.


Create


Once you have recovered your library you should back it up. See the user tip Backup your iTunes for Windows library with SyncToy for a suggested strategy.



Create

Should you be in the unfortunate position where you are no longer able to access your original library, or any backup of it, then see Recover your iTunes library from your iPod or iOS device or Recover media from an iPod for non-iOS devices.



If all other avenues for recovery are exhausted see HT208167: Hide and unhide music, movies, TV shows, audiobooks, and books - Apple Support to make sure that any purchased content that you want to retrieve is not hidden and then HT201272: Redownload apps, music, movies, TV shows, and books for guidance on downloading it.