wrote CLI in C++ to sort files. it’s very simple, just download and use. if you a photographer, video editor or just need to sort some files, you welcome (link in post)

    • bobo@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      5 hours ago

      It doesn’t sort them in the programming sense, it’s just moving files to another directory based on the filename

      qsort -w /home/user/Documents -t ext --df .txt
      

      is equivalent to

      ls *.txt | xargs -I {} mv {} /home/user/Documents
      
      
          • BB_C@programming.dev
            link
            fedilink
            arrow-up
            2
            arrow-down
            1
            ·
            3 hours ago

            I think the other user meant that ls output is not supposed to be treated as parsable, because the tool doesn’t offer any guarantees in that regards.

            Shells have built-in support for globbing files anyway. xargs is also not needed. If someone is allergic to using a shell for loop, find always had -exec with ; instead + which wouldn’t trip on too many arguments.

    • metw0@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      20 hours ago

      this is just a practice project, I shared it just so other people could take a look. you can see how it sorts files by checking out the repository