In this week i wrote a emacs program and tutorial that does archiving
a website for offline reading.
(See
http://xahlee.org/emacs/make_download_copy.html )
In the process, i ran into a problem with the unix “cp” utility. I've
been a unix admin for Solaris during 1998-2004. Even the first time i
learned about cp, i noticed some pecularity. But only today, i thought
about it and wrote it out exactly what's going on.
Here's a excerpt from my emacs tutorial above regarding the issue.
------------------
Copying a bunch of directories seems a trivial operation, but it
actually took me a couple hours to arrive at the final code, due to
the exact requirement of directory paths, and the unix “cp” tool's
lack of precision and flexibility.
Originally, i thought the code would be something simple like several
“(shell-command (concat "cp -R " fromDir " " toDir))”, one for each
source dir, where fromDir and toDir are full paths. However, it turns
out the problem is slightly more complex.