My MP3 player plays files in the order they have been placed onto the filesystem. Now it seems to Nautilus copies files in some random order, so when listening to an audio book or something I get all the chapters in random order, wich isn't so great when your on a bicycle so you can't take your MP3 player out of your pocket to find the right one. When using mc
(Midnight Commander) most files are copies in alphabetical order, and that's the way I want it to happen.
So is there...
- any way to tell Nautilus to copy files and folders in alphabetical order?
- a program wich can sort the files and folders in alphabetical order directly on the filesystem?
Additional information:
- Elementary OS 0.1 Jupiter (based on Ubuntu 10.10)
- 64-bits
- Copying music over from an NTFS filesystem to a strangely formed FAT32 filesystem on the MP3 player.
To embellish the answer by enzotib ; these players play files in the order they find them in the File Allocation Table (the FAT, in FAT).
FATSort is therefore one potential solution to the problem. The noted warning is for 2 reasons ;
fsck.vfat
check, you should be fine.fsck.vfat
(or a disk check in Windows), you should be fine - this is a belt-and-braces disclaimer by the authorpalimpsest
/ Disk Utility has options to do a disk check from the GUI.Other programs that sort the FAT can be seen here : http://www.murraymoffatt.com/software-problem-0010.html
Alternate solutions ;
Copy files in the play order
The simplest and most obvious is to copy the files to the player in the order which you wish them to play. Nautilus copies files in an apparently indeterminate order to the player file system for much the same reason - it tends to operate on files in the order the iNodes are arranged on disk.
If your track file names have the track number at the beginning, this is ideal. Most of the command line tools will sort things in lexicographic order. As you note, tools like Midnight Commander will also do this.
Create a playlist
Some players support playlist files. I keep scripts in my MP3 player filesystem to support generating these playlists. My player is an iRiver device, which has a specific binary playlist format. If your player supports .m3u playlists, the format is extremely simple, and just consists of commented metadata and paths in a text file. I used to make playlists in Rhythmbox and transform them to the iRiver format ; I've not had occasion to make one using Banshee yet (I only make them for workout purposes and my workouts are very predictable...)
The utility you look for exists, and is FATSort.
It is available in Ubuntu Repositories in the
fatsort
package.It could be that the player uses the modification time of the file. You could use a python script like the following to get all files in a folder, and
touch
them to change the last access time. Without the player, I can't test the result of cause.This script should be run on the player folder (replace "path_to_the_player_folder" with the actual path) like this (if you saved it as touch_all.py):
python touch_all.py "path_to_the_player_folder"
I have no idea on how to tell nautilus how to copy files. Others might answer that part of the question, though.
Regarding
fatsort
, use it like this :You need to figure out what dev it actually is - could be sda, sdb, etc.
should show you the mounted systems.
Find out which device name the MP3-Player has:
lsblk
(In my case it was
/dev/sdb1
)Show the current order of all files (without doing any changes):
sudo fatsort -l /dev/sdb1
Sort all files on the MP3-Player in alphabetical order:
umount /dev/sdb1
sudo fatsort -a /dev/sdb1
If
fatsort
complains about a defective file system => repair it:sudo dosfsck -r -l -v /dev/sdb1
Any questions about command line parameters:
man fatsort
man dosfsck