Menu

#1668 Command line option to disable file name sort altogether

open
nobody
None
5
2025-11-04
2025-08-29
oset jan
No

It is a request to turn off sorting altogether so files in the archive were ordered in order given by user or shell.
It's important in some applications, like Open Document Format, Office Open XML, Epub, Android Package, and some other, important to them.
What we want is to have these options: -mqs=off|name|type, where off means off, not 'name'.

Sorting by name would stay default but for special applications, with some listed above but not limited to them, user could choose to disable sorting.

It's also useful in updating container files, like listed above, when user wants to update specific file/s in the container but preserve structure of the files. Notable example is ODF where soffice cannot open documents packed with 7-zip but can open packed with Info-Zip.

Everyone consciously using this option is aware of the fact and knows what he is doing. Everyone making effort to enter option in command line is doing it purposefully and deliberately and agrees with the implications, like possibly slower opening on unsorted archive. All that applies to current '-mqs+', which would be '-mqs=type' in this case and everyone using it checks the result and decides whether it's worth of the effort or not.


OpenDocument format

Office Open XML

EPUB 3 documents

Android Package

Discussion

  • OnceThereCouldBe

    I agree, this would be extremely beneficial for me.

     
  • lelik007

    lelik007 - 2025-08-31

    Well, what can I say, I'd like to have a feature like this, but not sure what this @ipavlov 's quote means:

    There are some internal reasons why names are always sorted in 7-Zip.

    Maybe there's no way to turn sorting completly off.

     
    • oset jan

      oset jan - 2025-08-31

      names are always sorted in 7-Zip

      This is not exactly true. Not always.

      > echo a > a.txt; echo b > b.txt; echo c > c.txt
      > 7z a archive.7z a.txt c.txt
      > 7z a archive.7z b.txt
      > 7z l archive.7z
      
        Name
        ------------------------
        a.txt
        c.txt
        b.txt
        ------------------------
        3 files
      
      > echo aa >> a.txt
      > 7z u archive.7z a.txt
      > 7z l archive.7z
      
        Name
        ------------------------
        c.txt
        b.txt
        a.txt
        ------------------------
        3 files
      

      This will be unsorted, and will stay unsorted, even more, with every new update.

      So it can deal with unsorted names.

      Maybe there's no way to turn sorting completely off.

      As shown above - there is.

       
  • AlexS

    AlexS - 2025-08-31

    As I understood, file sorting is always present on NTFS. And it cannot be canceled. By default, sorting is by name. Until version 15.06, 7-zip used a non-system-specific file sorting - by extension. From version 15.06, the standard file sorting was restored - by name, so the instructions state that sorting is disabled (non-standard sorting is disabled). I hope I understood the essence correctly.

     
    • oset jan

      oset jan - 2025-08-31

      As I understood, file sorting is always present on NTFS.

      File sorting is always present, full stop.

      And it cannot be canceled.

      Now, it cannot.
      That's what this request is all about.

      so the instructions state that sorting is disabled (non-standard sorting is disabled). I hope I understood the essence correctly.

      Yes.
      Off means off.
      Sorting by name would be default, as it is now, only difference would be that user invoking sorting switch would have to choose desired sorting method.

       
  • Igor Pavlov

    Igor Pavlov - 2025-09-01

    7-zip uses internal sorting by name, because we need sorted lists for internal operations.
    Maybe we could support unsorted list for some simple cases, but it was not implemented.

     
  • Igor Pavlov

    Igor Pavlov - 2025-09-01

    Also if the order inside archive is same as order in NTFS volume, many operations work much faster on HDD with big number of files.
    So default order "by name" is good when 7-zip works with ntfs.
    Another order in 7z will create unusual order in NTFS after extraction, and NTFS HDD will be slow after that.

     

    Last edit: Igor Pavlov 2025-09-01
    • oset jan

      oset jan - 2025-09-02

      Also if the order inside archive is same as order in NTFS volume, many operations work much faster on HDD with big number of files.

      Are you trying to protect users from themselves?

      So default order "by name" is good when 7-zip works with ntfs.

      Didn't I say?:

      Sorting by name would be default, as it is now

      --

      Another order in 7z will create unusual order in NTFS after extraction, and NTFS HDD will be slow after that.

      It will not. Default order would stay the same.
      Just like now, to change sorting you must do it in command line, you would have to do it then.
      No difference to the users not using this option.

      Solid option is similarly organised - without option, by default, solid is on and is 'infinite'. Only way to change, whether to decrease block size or turn it off, it is to invoke right switch and that's user's conscious decision. If it affects compression, it is their choice.
      Sorting would work in the same manner - by default it would operate by name, but user could change it to 'none' or to 'type'.
      If that's what they want, more power to them.

       

      Last edit: oset jan 2025-09-02
  • OnceThereCouldBe

    Any progress on this?

     

Log in to post a comment.