Why is Snow Leopard sorting my files incorrectly?

Discussion in 'macOS' started by Mahombi, Oct 7, 2011.

  1. Mahombi macrumors newbie

    Joined:
    Sep 17, 2010
    Location:
    London, United Kingdom
    #1
    I am about to start renaming several thousands of image files and want to make sure that once renamed, they all sort correctly. I came up against a few problems with my renaming arrangement, so I ran some simple naming tests to see how things might look in Finder. The results have confounded me.

    I started by making three duplicates of a three digit numbered file. I renamed each by adding a series of zeros at the beginning, consecutively from one to three. These sorted as expected (or at least, in a uniform order). See below.

    000123.tif
    00123.tif
    0123.tif
    123.tif

    I repeated this using 234.tif, with the same results. However when I tried again with a randomly chosen number of 392.tif, they were sorted like this:

    00392.tif
    0392.tif
    000392.tif
    392.tif

    Two further repeats using 427.tif followed by 850.tif resulted in different, yet incorrect (to my mind) sorting arrangements to both those as well.

    As if that wasn't confusing enough, I copied and pasted all sixteen files to a new folder. With the exception of the 123.tif and 234.tif series of files, all of them displayed in a completely different sorting arrangement to the originals. Repeating that, resulted in yet another configuration where even the 123.tif and 234.tif files were disordered .

    I've tried selecting different sorting arrangements in View, quit the Finder and even restarted my Mac in the hope of refreshing the sorting, with no success.

    Can anyone explain what is happening here?
     
  2. r0k macrumors 68040

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #2
    How do you have the files sorted in Finder? Is it by last modified? Take a look at the sort option you have picked in Finder and try the various options. I have never seen a situation where I thought files were sorted incorrectly on any version of OS X so I'm confident you can figure this out. I did have a situation yesterday where totalfinder ( a shareware plugin for Finder that supports cut/paste and a single tabbed Finder window) momentarily sorted things incorrectly but I chalk that up to my meddling with 3rd party software and not any sort of bug in Finder.
     
  3. Mahombi thread starter macrumors newbie

    Joined:
    Sep 17, 2010
    Location:
    London, United Kingdom
    #3
    Why is Snow Leopard sorting my files incorrectly?

    I sorted by Name in Finder. I previously tried all of the other options, coming back to Name, where the arrangement resulted as I previously described.

    Now rOk, I'm about to tell something which will make you doubt my sincerity, if not my sanity on this topic.

    Immediately before replying to you, I opened Finder (the first time doing so since shutting down my Mac yesterday) to check my procedure once again. I now discover that thirteen of the twenty four files have been re-ordered in the correct sequence (i.e. 000123, 00123, 0123, 123). In one of the duplicate folders, all five groups of files line up correctly, whilst the others are sorted randomly. Does that sound spooky? It wouldn't be so bad if they all sorted in the same order as one another. Short of having a haunted computer, I think there is a software bug of some kind doing this.

    I have now written down the order these files are currently in and will take another look tomorrow when I re-start the Mac, to see if they have changed again.

    I'd be interested in any further comments from yourself on this, or indeed anyone else. Particularly anyone experiencing similar problems.

    In fact, if someone is interested enough to actually repeat my experiment, at least at the end of it, I would know if this problem is unique to me or my system.
     
  4. Mahombi thread starter macrumors newbie

    Joined:
    Sep 17, 2010
    Location:
    London, United Kingdom
    #4
    Why is Snow Leopard sorting my files incorrectly? Reload this Page

    Right. Well I couldn't wait until tomorrow. I just re-started my computer twice, followed by opening the Finder and the folders in question. Each time, the files in each folder were re-sorted in a different order to the previous time. As before no folder's files corresponded with any of the others.

    As far as I am concerned, I am not going mad and there is definitely a bug of some kind in Snow Leopard's sorting in Finder.

    Can anybody prove me wrong? Am I doing something to cause it? If so, what is it?
     
  5. Damo01 macrumors regular

    Joined:
    Feb 11, 2010
    Location:
    Australia
    #5
    I'm not sure. But it maybe got something to do with your file naming convention by adding series of "zeros" to the name file and Finder doesn't know how to sort it the way you like it to be sorted...
     
  6. Mahombi thread starter macrumors newbie

    Joined:
    Sep 17, 2010
    Location:
    London, United Kingdom
    #6
    That would be easier to understand if Finder sorted all of files the same way. And, if it didn't change the sorting sequence whenever I shutdown and re-started my Mac.

    I made a point of putting the duplicate files in each of four new folders. Each set of files sorted differently to the others. There is simply no continuity between any set of files, whether in the same folder or in different folders.

    I have now just opened them all again in Finder for the first time since booting up today. Once again, another sorting arrangement.

    Would you care to try out the same experiment Damo01 (or anyone else) and let me know your findings? For the sake of continuity, it might be better to use the same series of numbers. Although I believe it will happen to any number. Numbers used were 123, 234, 392, 427 and 850. No need to use all the numbers, or as many files and folders as I did. If it's endemic, it will probably show up with fewer.
     
  7. r0k macrumors 68040

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #7
    Ok yes this is a bug in Finder

    In terminal, I used the "touch" command to create a bunch of empty text files with numeric names. They are sorted just fine in terminal with the "ls -al" command, but open the folder in finder and it becomes...

    Code:
    00998.txt
    000998.txt
    9988.txt
    09988.txt
    0009988.txt 
    
    when it should have been...
    Code:
    -rw-r--r--    1        0 Oct  8 10:56 000998.txt
    -rw-r--r--    1        0 Oct  8 10:56 0009988.txt
    -rw-r--r--    1        0 Oct  8 10:55 00998.txt
    -rw-r--r--    1        0 Oct  8 10:56 09988.txt
    -rw-r--r--    1        0 Oct  8 10:56 9988.txt
    I would say go to apple.com and use the feedback form to turn this in as a bug. I'm sure it won't make 10.7.2 as they are so focused on iCloud, but I wouldn't be surprised if it makes 10.7.3 but only if you turn it in. Another option is to call Applecare and go through this with them on the phone. Again, any of us with Lion are entitled to support for 90 days from whenever in July we bought Lion. It was July wasn't it?
     

    Attached Files:

  8. Mahombi thread starter macrumors newbie

    Joined:
    Sep 17, 2010
    Location:
    London, United Kingdom
    #8
    Thank you r0k, for proving it wasn't me going mad, or doing something stupid. I will report it to Apple. As it's in Snow Leopard, I'm wondering if they will bother at all now that the new baby's arrived.

    Terry

    ----------

    Of course r0k, when you say 10.7.2 and 10.7.3, you are probably referring to Lion. Forget I said anything.

    And thank you again.

    Terry
     
  9. gyorpb macrumors member

    Joined:
    Sep 15, 2011
    Location:
    Amsterdam
    #9
    r0k, your files are sorted correctly. Finder sorts "smartly", placing "1.foo" before "02.foo", as opposed to simple ASCII sorting, as Terminal does, sorting those two the other way around.

    For the OP's problem, there is a possibility Finder classifies the names of your files as all the equal, as far as sorting is concerned.

    .tsooJ
     
  10. Mahombi thread starter macrumors newbie

    Joined:
    Sep 17, 2010
    Location:
    London, United Kingdom
    #10
    gyorpb, re: my sorting problem. Just for the record, the sorting order in Finder changes whenever I shutdown and restart. So whatever sorting method Finder is using, it keeps changing its mind.

    Terry
     
  11. Damo01 macrumors regular

    Joined:
    Feb 11, 2010
    Location:
    Australia
    #11
    I got the same result. My thinking is that Finder doesn't have that sorting arrangement.
     
  12. Mahombi thread starter macrumors newbie

    Joined:
    Sep 17, 2010
    Location:
    London, United Kingdom
    #12
    Well currently, my thinking is that Finder doesn't have any reliable sorting arrangement!
     
  13. MacUser1001 macrumors newbie

    Joined:
    Oct 7, 2011
    #13
    Mahombie, as gyorpb alluded to, it looks like Finder doesn't always recognize leading zeros in its sort hierarchy if the number of digits in the name are not the same, i.e. 392=00392=000392, etc., so when you reopen a folder, no particular sort has been specified (and then apparently, the sort is random, or based on some nether-worldly reasons).

    What happens if you always the same amount of digits for each file?
    i.e. 000001, 000002,......000392, 000393,
     
  14. Mahombi thread starter macrumors newbie

    Joined:
    Sep 17, 2010
    Location:
    London, United Kingdom
    #14
    Point taken MacUser1001. You are correct with your analogy.

    It is an awkward sorting system however, that in the arrangement choices, there is provision only for left hand alignment and not for the right. It means that one must look at the period in the extension as if it is a decimal point. In other words, not very user friendly.

    It would make things easier if Finder made the same choices each time, with numbers of this kind, instead of the arbitrary method it employs.

    Thanks for your helpful input though.
     

Share This Page