order of source_dirs in cp(1)

Alexander Best arundel at freebsd.org
Sat Apr 7 20:44:21 UTC 2012


On Thu Apr  5 12, Matthias Apitz wrote:
> 
> Hello,
> 
> I was doing
> 
> $ cp -Rv 10 11 12 13 14 15 16 17 2 /mnt/osm
> 
> and was surprised seeing that source_dir 17 was done before 16; the man
> page does not specify the order, but I was thinking it just goes through
> the list in the given order...
> 
> Why this is done this way?

i can't remember the reason, but the question has been raised quite often.
try searching the archives. i think it had something to do with performance
or getting better disk locality, but i'm not sure. however people were argueing
whether copying the files in reverse order is really a benefit or not.

cheers.
alex

> 
> Thanks
> 
> 	matthias
> -- 
> Matthias Apitz
> e <guru at unixarea.de> - w http://www.unixarea.de/
> UNIX since V7 on PDP-11, UNIX on mainframe since ESER 1055 (IBM /370)
> UNIX on x86 since SVR4.2 UnixWare 2.1.2, FreeBSD since 2.2.5


More information about the freebsd-questions mailing list