C coding tips please / Localisation

Michael cuscotravelservices at gmail.com
Tue Jul 14 21:51:13 UTC 2015


Wayne Davison <wayned <at> samba.org> writes:
> The best place to add that include and the gettext define would be to put
them in rsync.h somewhere, which would make the localisation idiom available
in all the .c files.  Putting it down at the bottom of the file would be a
reasonable spot for it.

Hi Wayne,

I thought you must have fallen off the face of the earth or something like that.

I have moved the code to rsync.h, as suggested, and that is working. :)


> For your localisation efforts, I'd recommend that you either make a "git
clone" of the source and change that since that makes it easy to diff your
changes and make a patch file with the end results of what you've done. You
could also just keep an unchanged version in a directory and use "diff -ru"
on the old and new directory hierarchies should you not want to learn to use
git.


I have no experience with git. I don't have time to waste; how steep is the
learning curve?

Is "diff -ru" a command that is used within the git interface?

Some of the terminology seems a bit obtuse and some of the associated
descriptions, on the following page, are vague and lacking in detail.

https://download.samba.org/pub/rsync/rsync.html

Using luckyBackup (which is how I learnt about rsync and what is driving my
need to localise it) for testing, I was trying to determine what "Literal
data" and "Matched data" actually refer to and how and when the values are
populated.

Until I understand that, I can't determine how I think that "Literal data"
and "Matched data" could be better expressed for inexperienced users.

The aforementioned page has the following description for "Total transferred
file size".

Total transferred file size is the total sum of all files sizes for just the
transferred files.

Is the above affected ??? modified files ???

Does the "Total transferred file size" represent the final size of the files
which were transferred or updated or should it represent the size of newly
transferred files plus the differences for the updated files? Or, does it
only represent the size for files that were transferred in their entirety?

Is "Literal data" supposed to refer to only the total size of the
differences transferred for updated files?

One test I made was to add a line of text to a file to see what effect it
would have on the output for "Literal data". I expected to see only a few
bytes but the output indicated it was using the complete size of the file.

I was using that test to see if the following description, about rsync, was
accurate.

"It is famous for its delta-transfer algorithm, which reduces the amount of
data sent over the network by sending only the differences between the
source files and the existing files in the destination."

My initial understanding, of that description, is that rsync transfers the
differences for a given file that has been modified or updated in some way.
Now, I am wondering if what it is really saying is that it transfers
complete files whether they be files that have been added to the Source
directory and don't exist in the Destination directory or they are existing
files that exist in both the Source and Destination directories and the
files that are in the Source directory have been modified or updated in some
way. 

Please also clarify what "Matched data" refers to.

Thanks, Michael.




More information about the rsync mailing list