my car deck browses the files on a removable disk in the order they were copied to the removable disk instead of in alphabetical order. I *think* linux copies files to removable disks based on size and not in alphabetical order. Is there anyway to force it to copy in alphabetical order instead so they are in a usable order when i try to play the songs in my car?
-
-
Assuming you're using bash, something like:
for i in `ls *.mpg`; do cp $i /path/to/disk/; done
should work. -
Code:for i in `ls *.mp3`; do cp "$i" /path/to/disk/;sync; done
-
ive got windows also, any idea what that was called?
and ill try those command line options when i get a chance -
I had to look for it on a backup of an old D: drive that I saved many years ago, it was called FATSort.
-
And it's even still out there, and proposed for solving the problem of the OP...
Good Luck.. -
Flushing the buffers before removing the device is a good idea but if you unmount (which you always should) then you're fine. -
The linux one appears to be by a different author, it's available in the Debian Etch repository, and probably in one of Ubuntu repositories. -
Good Luck.. -
The sync is necessary to ensure that the FAT directory entries are written in the correct order. What I found is that if I didn't use the sync command after each track is copied then occasionally two tracks would be in the wrong order.
BTW I am talking about a very specialised case with a minority of mp3 players, so please lemur don't take this as dumping on your message, as what you say would apply most of the time. -
jas, no problem, we are in a linux forum - and I wasn't aware of the linux program.
-
Most mp3 players that I've dealt with were either good enough to play mp3s in some sort of logical order independently of the order of copy or were devices which needed a specific order. For the latter only the order of the copies matters. These devices are lacking in the human interface department but technically that behavior is not a bug.
Let's say you mount an external drive on /mnt and you do this:
Code:cp A /mnt/ cp B /mnt/
Things get more complicated with journaling file systems depending on what is journaled precisely but we're talking about fat here.
This being said, yeah, there may be devices out there which are buggy. Or even drivers which are buggy. I've had to deal with buggy USB drivers in Linux before (maybe 2 years ago): I had to go through hoops to get them to behave properly. (Like mount the drive with special flags or unload high-speed USB modules from memory before using those devices.) Devices which really need "sync" between copies are not just badly designed but are buggy.
These buggy devices are not the norm. -
Off on a tangent, I'm on the look out for a new mp3 player, that is linux friendly, because my Trekstor Vibez mp3 players hard drive has just begun to failThe Cowan iAudio 7 16GB Flash player looks interesting but according to the reviews doesn't have the same sound quality as my current player.
-
That's the 32GB version, but you can also get it in 16, 8 and 4 GB. It's got great sound quality, and works with Amarok or Gnomad2. I bought it a few weeks back to replace my dying iPod Photo, and it's got amazing sound quality. -
Oh, and I avoid Creative. My reason to avoid them is ideological. There was a flap with Creative going after a guy who modded some of their drivers:
http://digg.com/mods/Creative_Goes_After_Driver_Modder
I really don't care whether Creative had a legal right to go after the modder. The fact is that Creative was providing drivers which crippled the capabilities of their hardware on purpose. The guy modded the drivers to uncripple the hardware. Creative went after him. Not cool. Creative eventually backed off but I'm still not trusting them. -
I have to admit that I've not liked Creative mp3 players in the past, but I've forgotten the reasons why.
A short list of my pros and cons for the Creative ZEN
Pros:
large flash memory size.
sound quality.
Cons:
Requires an application to transfer tracks.
Limited file formats (i.e. no Vorbis ogg).
Multimedia player.
I'm not sure if it does gapless playback, sadly very few players have the feature, and even fewer do it properly.
Lemur, a good reason not buy Creative. -
when i tried fatsort, here was the output: (where FEDORA is the name of my usb drive)
Code:cleippi@Christopher-PC:~/Music$ fatsort /media/FEDORA/ FATSort Utility 0.9.8.2 by Boris Leidner <fatsort(at)formenos.de> check_mounted: Unable to get realpath! sort_fs: Could not check if filesystem is mounted! main: Failed to sort file system! cleippi@Christopher-PC:~/Music$
Code:cleippi@Christopher-PC:~/Music$ for i in `ls`; do cp $i /media/disk/; done cp: cannot stat `30': No such file or directory cp: cannot stat `Seconds': No such file or directory cp: cannot stat `From': No such file or directory cp: cannot stat `Mars': No such file or directory
-
The command line is tripping out over spaces.
-
Probably putting double quotes around $i in the original for loop would be enough:
Code:for i in `ls`; do cp "$i" /media/disk/; done
Code:$ cd ~/Music/ $ find . -type f -print0 | xargs -0 -iXX cp XX /media/blah/
-
-
Examples:
fatsort -h
fatsort /dev/sda
fatsort -c -oa /dev/sda1
Timber's right. If you don't know what device it is, insert it and let it mount automatically, then on a command line run 'mount'. In the output, look for the mount directory (/media/FEDORA/) and on the same line it should show the device (sda1, sdb1).
BTW, thanks guys for bringing fatsort to my attention. I have the same problem with a Creative Zen Stone Plus.Last edited by a moderator: May 8, 2015
get linux to copy files to a removable disk in alphabetical order
Discussion in 'Linux Compatibility and Software' started by Fittersman, Jun 13, 2008.