iTunes and renamed files

Jump to First Reply
Posted:
in iPod + iTunes + AppleTV edited January 2014
Hi.

I noticed that iTunes can play a song even if you rename, or move, the file after adding it to the library. How is this possible?

Comments

  • Reply 1 of 5
    shetlineshetline Posts: 4,695member
    Quote:

    Originally posted by andersw

    I noticed that iTunes can play a song even if you rename, or move, the file after adding it to the library. How is this possible?



    My guess: That you aren't renaming or moving the music files that iTunes is really using.



    If you drag music files into iTunes, or ask iTunes to find music files for you, by default iTunes copies those files into its own music library directory structure. iTunes plays its copies, not your originals, and my guess is that you were mucking with the original files.



    iTunes can be configured to simply use the original files from their original locations, but that's not the default behavior for iTunes. In this alternate configuration, renaming and moving files would cause problems.



    If you've got a lot of music, you could be using up quite a bit of drive capacity on duplicate music files.
     0Likes 0Dislikes 0Informatives
  • Reply 2 of 5
    anderswandersw Posts: 5member
    Quote:

    Originally posted by shetline

    My guess: That you aren't renaming or moving the music files that iTunes is really using.



    If you drag music files into iTunes, or ask iTunes to find music files for you, by default iTunes copies those files into its own music library directory structure. iTunes plays its copies, not your originals, and my guess is that you were mucking with the original files.



    iTunes can be configured to simply use the original files from their original locations, but that's not the default behavior for iTunes. In this alternate configuration, renaming and moving files would cause problems.



    If you've got a lot of music, you could be using up quite a bit of drive capacity on duplicate music files.




    Thanks for your answer.



    The interesting thing, however, is that I have turned off the option where iTunes copies the files, so the files I am renaming are really the same files that are in the iTunes library. I have confirmed this by doing a "Show Info" on the files in iTunes before and after my renaming (the file name had changed).



    I actually discovered this when I played an incompletely (and legally...) downloaded mp3 file in iTunes. When the download was finished it was automatically renamed and moved, but I didn't have to add it again.



    Of course this is a very useful feature, but I'm curious about how it works technically. If I remember correctly (which I might not) iTunes in OS 9 did not behave this way, so I guess it's something OS X specific. Hm...
     0Likes 0Dislikes 0Informatives
  • Reply 3 of 5
    foadfoad Posts: 717member
    This is not just with iTunes. OS X pretty much functions this way. For example, open and close a document in Word. Rename the file in the Finder. Now in your recent file list, click on the original file name. It will open you renamed file automagically.
     0Likes 0Dislikes 0Informatives
  • Reply 4 of 5
    shetlineshetline Posts: 4,695member
    Quote:

    Originally posted by andersw

    Of course this is a very useful feature, but I'm curious about how it works technically. If I remember correctly (which I might not) iTunes in OS 9 did not behave this way, so I guess it's something OS X specific. Hm...



    Files in OS X have unique file IDs which remain the same even after renaming or moving files. I'm just surprised that iTunes would be using these IDs in preference to the file's path for finding files. The XML version of the iTunes database doesn't seem to have file ID numbers in it -- just file paths -- so file IDs must only be stored in the binary who-knows-what-format of the database.



    OS 9 has file IDs too (I imagine this is an HFS file system feature), so I don't know why iTunes in OS 9 wouldn't have used IDs in the same way.
     0Likes 0Dislikes 0Informatives
  • Reply 5 of 5
    anderswandersw Posts: 5member
    File IDs... That's good. Didn't think of that. Thanks for your explanation.



    Just to clarify: I might be wrong about this with OS 9. Haven't used it for a long time.
     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.