-   Linux - Software (
-   -   cp will copy in any order, not alphanumeric (

DaveQB 01-10-2009 12:17 PM

cp will copy in any order, not alphanumeric

I have now come across 2 devices that play back audio files back in timestamp order; the timestamp they were copied to the device.

I have found that cp and konqueror [and Windows for that matter] copy files in a real ad-hoc order, thus making the preservation of playlist orders impossible. So I have had to resort to copying each file, one-by-one in the order I want, alphanumeric.

Is this to be expected by cp ?

I have had to write a script now to get around this in a easier fashion
my blog post about this.

penguiniator 01-10-2009 03:33 PM

Yes, it is to be expected. The order of files on disk has nothing to do with their filenames, so if you want to copy files in alphanumeric filename order, a script is the way to go.

DaveQB 01-10-2009 08:04 PM


So curious, is it in inode order ?

penguiniator 01-10-2009 09:15 PM

Not necessarily. It depends on how the filesystem is designed. Inodes and filenames are not stored together, and filenames are not guaranteed to be in sort order.

All times are GMT -5. The time now is 11:53 AM.