Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Thrash911

macrumors 6502
Original poster
Sep 14, 2006
297
4
Jutland, Denmark
Hello people,

I need to sort files on a FAT drive (SD card). But I can't find an app that can do this on OS X.

This is a Windows app: http://www.anerty.net/software/file/DriveSort/?lang=en

Is there anything like this on OS X? I don't want anything I have to compile/build/make, since I think that is confusing as hell.. :eek: I found YAFS for mac, but that required a library I could not find for OS X. :mad:

I prefer a GUI app, but I am not allergic to Terminal.. Is there anything like this for OS X? I'm on 10.9.2, Maverick.
 
Last edited:

meme1255

macrumors 6502a
Jul 15, 2012
742
594
Czechia
Touch command changes timestamp. How'd you like to sort you files? Alphabetically? Simply combine touch, ls and sort commands depending on your desired result :)

How would you like to sort your files?
 

Thrash911

macrumors 6502
Original poster
Sep 14, 2006
297
4
Jutland, Denmark
Touch command changes timestamp. How'd you like to sort you files? Alphabetically? Simply combine touch, ls and sort commands depending on your desired result :)
Unfortunately, that will not work. The files will have to be rearranged on the SD card, in order for it to work. I use the card on a "stupid" system, that reads the card "raw", and displays the files in the order it was written to the card.

But thanks. ;)
 

meme1255

macrumors 6502a
Jul 15, 2012
742
594
Czechia
It WILL work ;) As touch creates new timestamp (== date written), you can combine it with other commands in order to get your desired sorting :)
 

Thrash911

macrumors 6502
Original poster
Sep 14, 2006
297
4
Jutland, Denmark
Of all (few..) I have found so far for OS X, this one looks most promising, I think:

http://fatsort.sourceforge.net

Latest version is v1.2.355. But it will have to be compiled, by using make and install. I know nothing about this. I did try to run "make install" from terminal, but I got something like "man/fatsort.1: No such file or directory". This is where my "knowledge" stops.. :(

I would be eternally grateful, if someone in here who knows how, could guide me through this process, so I can get a binary. I have Xcode installed, so I should have the tools necessary.

----------

It WILL work ;) As touch creates new timestamp (== date written), you can combine it with other commands in order to get your desired sorting :)

Okay. What the hell, I'll give it a whirl.. :) I want EVERYTHING sorted alphabetically. There are several directories and sub directories. So.. What should I do? :)
 

Thrash911

macrumors 6502
Original poster
Sep 14, 2006
297
4
Jutland, Denmark
UPDATE:

I finally managed to compile and install it. There were two makefiles - I used the wrong one. It was the makefile in the 'src' subfolder I was supposed to use. And now I have successfully managed to sort the files on my FAT32 SD card. Now the files show up on the Amiga :)p) in correct alphabetical order. Yay!

It pays to be persistent. I learned something today. :) Thanks to everybody who tried to help me. Much appreciated!
 

d0nK

macrumors 6502
Nov 4, 2011
392
209
UK
Cheers for this info.
Exactly what I needed to sort the files on my HxC floppy emulator SD card.

I found this site helpful for installing and usage.

I also use CleanEject which delete's all the .spotlight, .trashes files, etc on eject.

I'm not affiliated with any of these sites that I've linked to btw.
 

beachball doom

macrumors member
Feb 1, 2016
40
8
Hey guys I was just trying to do this and wasted a solid hour or two with no success. I then changed tactics and got my mp3player sorted in only a few minutes using WINE to run one of several available windows applications. The one I used was freeware called "SD sorter".
 

Thomas Harte

macrumors 6502
Nov 30, 2005
400
4
Extremely late in the day but this seems to be my search engine's first result for the question, so: I found that using the Finder simply to move the files off their original media, setting a sort order on the folder into which I've moved them, and then moving them back seems to have the lucky side effect of preserving that order in the on-disk FAT ordering. And — as unintended as I'm sure it is — this has been true of at least the last few versions of macOS.
 

ltpitt

macrumors regular
Feb 18, 2020
110
39
Hi all!

I would really love to have fatsort (or any other similar utility) for my eMac (running os 9 and leopard) but I cannot compile fatsort latest version because of many errors.

Maybe someone can be so kind to share the source of an old version compatible with mac os x leopard so that I can compile it or the whole program compiled?

Thanks for your time and patience.
 

bogdanw

macrumors 603
Mar 10, 2009
5,719
2,751
Maybe someone can be so kind to share the source of an old version compatible with mac os x leopard so that I can compile it or the whole program compiled?
Probably v0.9.14 would compile on Leopard
I think this is the link for v0.9.14 (May 14, 2010) https://sourceforge.net/code-snapshots/svn/f/fa/fatsort/code/fatsort-code-r210-trunk.zip
and this is for v0.9.14.1 (June 11, 2010) https://sourceforge.net/code-snapshots/svn/f/fa/fatsort/code/fatsort-code-r214-trunk.zip
 
  • Like
Reactions: ltpitt

ltpitt

macrumors regular
Feb 18, 2020
110
39
Probably v0.9.14 would compile on Leopard
I think this is the link for v0.9.14 (May 14, 2010) https://sourceforge.net/code-snapshots/svn/f/fa/fatsort/code/fatsort-code-r210-trunk.zip
and this is for v0.9.14.1 (June 11, 2010) https://sourceforge.net/code-snapshots/svn/f/fa/fatsort/code/fatsort-code-r214-trunk.zip
Deeply thanks for your kind help in this retro-quest!

Your suggestion put me in the right direction and I kept digging in sourceforge until I found out that the most recent version able to compile successfully on my eMac 1.25Ghz using (Sorbet) Leopard is r522:

After fiddling a bit I was able to make it work manually and also using brew (tigerbrew).

Manual install instructions
Download the zip file above, extract it and open a terminal and navigate to the folder where you extracted the zip file.
Then get in the repo folder using:
Code:
cd fatsort-code-r522-trunk

and then run:
Code:
make
make install

At this point fatsort should be installed and you can test with:
Code:
fatsort -v

Brew install instructions
I tried installing fatsort using brew (tigerbrew):
Code:
brew install fatsort

But this caused an error about non existing file because the url provided in the formula seems to be gone.

Fixed the formula editing /usr/local/Library/Formula/fatsort.rb (if you don't have this file be sure to run brew install fatsort first), removing all the content and pasting the following:
Code:
class Fatsort < Formula
  desc "Sorts FAT16 and FAT32 partitions"
  homepage "http://fatsort.sourceforge.net/"
  url "https://mirrors.aliyun.com/macports/distfiles/fatsort/fatsort-1.5.0.456.tar.xz"
  sha256 "a835b47814fd30d5bad464b839e9fc404bc1a6f5a5b1f6ed760ce9744915de95"

  depends_on "help2man"

  def install
    system "make", "CC=#{ENV.cc}"
    bin.install "src/fatsort"
    man1.install "man/fatsort.1"
  end
end

I tested the corrected formula and it seems to work fine so I created a pull request to get it into tigerbrew.

Once this is pull request approved our next install should be as easy as:
Code:
brew update
brew install fatsort

The above command worked perfect on my eMac g4 with Leopard.

On my iMac g3 with Tiger the same command returned errors and to make it work I had to use:
Code:
brew update
brew install fatsort --cc=gcc-4.0


Troubleshooting (maybe valid for both solutions, I am not sure)
1) Libiconv error

I got some errors related to missing libraries and during my manual fix I had to install libiconv, I did that using brew (tigerbrew):
Code:
brew info libiconv

2) Locale error
When I ran fatsort I got a locale error:
WARNING: The C locale does not support all multibyte characters!

This was because I had to fix the locale on my Mac.
I was not sure about what to do so I decide testing a new locale configuration at runtime before making it permanent.
I did that with the following commands:
Code:
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Then I tried running fatsort and all was fine!
So I made the fix to my locale permanent:
Code:
echo 'export LANG=en_US.UTF-8' >> ~/.bash_profile
echo 'export LC_ALL=en_US.UTF-8' >> ~/.bash_profile

And activated the new locale so I did not have to restart my terminal:
Code:
source ~/.bash_profile

This makes possible to install fatsort with a simple:
Code:
brew install fatsort

I am currently trying to get the latest version working, in case I have some success I will update this post.

Enjoy :)
 
Last edited:

ltpitt

macrumors regular
Feb 18, 2020
110
39
Hi all,

I hope you are enjoying lovely Xmas days.

Good news!
My patch to tiger brew was accepted and now you can install fatsort on our beloved macs with tigerbrew just using:
brew install fatsort

Enjoy :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.