Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate proper remote path from Windows path #287

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

vilcans
Copy link

@vilcans vilcans commented Apr 20, 2023

Thanks for this software! I had been using my own bash script for this until now and was going to implement it in Rust, but now that you did it I don't have to!

Anyway, Windows client support opens up the use case of letting my poor friends with Windows machines build things on my server. Without this patch, mainframer tries to create a directory directly under my home directory (instead of under ~/mainframer) and with a name containing a colon which causes rsync to fail.

This fixes two things with canonical paths in Windows:

  • It uses backslashes as path separator. Replace this with "/".

  • As of the current implementation of std::fs::canonicalize, the path begins with "\?\C:", where C is the drive letter. Replace this with "/C/" to avoid the "?" and ":".

With this fix, I can run the client in MSYS2 in Windows. It should work with any shell where there is an rsync command, like Cygwin.

Fixes two things with canonical paths in Windows:

* It uses backslashes as path separator. Replace this with "/".

* As of the current implementation of std::fs::canonicalize,
the path begins with "\\?\C:\", where C is the drive letter.
Replace this with "/C/" to avoid the "?" and ":".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant