- Related Software
The PhatSort project provides two command-line utilities for sorting files
and directories on FAT filesystems. The
phatsort utility sorts files and
directories that are already on the filesystem. The
seqcp utility copies
files and directories to the filesystem in sorted order.
There are many MP3 players that allow you to mount the device as external
storage and manage the media yourself. The storage generally uses a FAT
filesystem. When copying multiple files onto the storage, using the command
mv) or a GUI, they are generally stored in an arbitrary order.
This is not a problem if the firmware of the MP3 player sorts by filename, but
many MP3 players use the order in the FAT filesystem without sorting, which
results in podcasts and album tracks being played out of order.
There are some utilities that sort the FAT tables of an unmounted filesystem. (See Related Software for information and links.) Unfortunately, there are many devices for which this does not work. PhatSort takes a different approach to solving the problem. It works by creating new directories and moving (“renaming”) the files in the desired order, while the filesystem is mounted. This method works on all devices that have been tried so far.
PhatSort also (optionally) forces the filesystem buffers to be written to the
storage media after each change. This helps avoid write failures when using
devices that have problems with writing large amounts of data. Note that the
seqcp utility helps with this issue even on non-FAT filesystems.
PhatSort has only been tested on Linux. It might work on other operating systems. Scripts that are output use POSIX shell commands and therefore require a POSIX shell to execute.
.deb Package Installation
Check the Releases page for
.rpm Package Installation
Check the Releases page for
Installation From Hackage
$ cabal v2-install phatsort
Installation From Stackage
$ stack install phatsort
FATSort is a command-line utility that
sorts unmounted FAT filesystems by direct manipulation of the FAT tables.
Unfortunately, there are many devices for which this does not work.
DriveSort is Windows GUI
software that sorts unmounted FAT filesystems by direct manipulation of the
FAT tables. I have not tried it.
- Hackage: https://hackage.haskell.org/package/phatsort
- Stackage: https://www.stackage.org/package/phatsort
- GitHub: https://github.com/ExtremaIS/phatsort-haskell
- GitHub Actions CI: https://github.com/ExtremaIS/phatsort-haskell/actions
All releases are tagged in the
main branch. Release tags are signed using
email@example.com GPG key.
Issues and feature requests are tracked on GitHub: https://github.com/ExtremaIS/phatsort-haskell/issues
Issues may also be submitted via email to firstname.lastname@example.org.
This project follows the Haskell package versioning policy, with
A may be incremented arbitrarily for
non-technical reasons, but semantic versioning is otherwise
A.B is the major version,
C is the minor version, and
is the patch version. Initial development uses versions
0.0.0.D, for which
every version is considered breaking.
The format of this changelog is based on Keep a Changelog, with the following conventions:
- Level-two heading
Unreleasedis used to track changes that have not been released.
- Other level-two headings specify the release in
A.B.C.D (YYYY-MM-DD)format, with newer versions above older versions.
- Level-three headings are used to categorize changes as follows:
- Changes are listed in arbitrary order and present tense.
optparse-applicativedependency version upper bound
- Check that each target directory is not a mount point
syncsystem call via FFI instead of running the
- Add tests using mocking
- Refactor Nix configuration
- Add support for
- Add Cabal support to
- Add Cabal tests to GitHub Actions
- Add stan static analysis
- Use GitHub Actions instead of Travis CI
- Rename Git default branch to
- Add syncing,
- Add Nix configuration
- Switch back to using
- Add Travis CI
- Turn off threading
- Initial public release