On Mon, Apr 25, 2005 at 11:17:07AM +0200, chth@gmx.net
wrote:> rsync does not list files if used locally without a destination but it
> does when used remote archives, this is not orthognonal.
Correct. This is the historical way rsync has worked, and I haven't
changed it -- at least, not yet. I did make it possible to list files
from a local transfer, but you need to still include a destination along
with the --list-only option. I like your idea of having rsync not fail
if the destination directory is missing when --list-only was specified.
> My current workaround is to rsync -n against an empty dir and filter
> out any other noise lines from the list
When parsing the output of rsync, it is always better to use the
--log-format option with a prefix (something like %i or %t) to make
parsing the output more accurate than parsing the verbose messages.
> Would be nice if the noise lines go to stderr instead stdout (or even
> omited when using --list-only).
I think the --list-only lines are unique enough that they can be
reliably differentiated from the rest of the output by a script.
> How about a --list-only0 which sends '\0' terminated lines?
The CVS version of rsync outputs non-printable parts of a filename using
octal (e.g. \012) escapes plus "\\" for backslash, so your script can
get the full name of each file without needing them to be '\0' separated
(it would just need to first change "\NNN" sequences back into a
single
char, and then change any "\\" sequences into a single backslash).
..wayne..