Search code examples
windowsrsyncmsysmingw-w64

Want to port existing rsync on windows


I know currently there is rsync for windows available as G-Rsync. That is this :- http://sourceforge.net/projects/grsync-win/

But, what I want to do is just make existing rsync code available from here :- https://rsync.samba.org/download.html to be run on windows.

I have checked :- https://stackoverflow.com/questions/528298/rsync-for-windows but, that is not what I want. Also, I have found https://github.com/MatthewSteeples/rsync.net rsync port to .net.

Also, windows use WinSock instead of socket system call (so, I cannot write entire rsync for windows from scratch). So, I have checked MingW-w64 here:- http://mingw-w64.sourceforge.net

I guess there must be some method to port existing rsync code to windows. Also, this following link doesn't help me :- Technical Hurdles for Win32 rsync port

I am not very sure would this MingW-w64 help me.Can I use this tool to port existing rsync on windows. I also want to know , what does MingW-w64 is used for? Also , please bring to my notice if I am missing anything here.

[Edit] I found these projects

  1. https://github.com/meeuw/rsync-mingw32 (can't find documentation for this project, readme.txt is same as rsync's).

  2. http://sourceforge.net/projects/mingw/files/MSYS/Extension/rsync/rsync-3.0.8-1/ (this needs MSYS console to configure MSYS-build-rsync).

but,can't figure out whether these options will serve my purpose?

can anyone please comment what is these above mentioned 2 projects about?

Thanks in advance.


Solution

  • rsync was designed and built for Unix-y (POSIX compliant) systems. Windows is not a POSIX compliant Unix system. That is why you can't build the source code directly on Windows.

    It depends on your application as to what you are trying to achieve but I think you have found the two main POSIX layers for Windows (Cygwin and MinGW). Those two POSIX layers add a level of POSIX compliance on top of standard Windows. This allows applications such as rsync to be easily ported to run on Windows.

    So to answer your original question: if you want to port rsync to Windows then you will need to either rewrite large portions of rsync or use a POSIX compliance layer such as Cygwin or MinGW.