fix file sync so that it works with windows and *nix