docker-windows-volume-watcher icon indicating copy to clipboard operation
docker-windows-volume-watcher copied to clipboard

host-mnt can be in different formats

Open Bazek opened this issue 4 years ago • 5 comments

My possible paths are:

/run/desktop/mnt/host/C/some-path
C:\some-path

Bazek avatar Feb 24 '21 16:02 Bazek

Hi @Bazek , do you know how to build this on my local PC? I want to use this~

masquevil avatar Feb 27 '21 13:02 masquevil

Hoi. It'd be great if this change, or something similar, was merged into the pypi release. I hit the same issue, because /run/desktop/mnt/host/${drive}/... on my system...

slippycheeze avatar Aug 28 '21 09:08 slippycheeze

Just came across this issue, and since many systems have different host paths, why not have some sort of flag / arguments passed through cmd while running the program. That way we can also preserve the backwards compatibility, and different paths can also be accommodated?

(my path was in C:/something/something format)

biplobmanna avatar Mar 04 '23 10:03 biplobmanna

From what I observe, we have 2 cases to consider:

  1. *nix style path of format /some/mnt/or/host/path/ preceding the actual system path eg: /run/desktop/mnt/host/C/some/path/to/the/thing or /host_mnt/C/some/path/to/the/thing

  2. Windows style path, eg: C:\some\path\to\the\thing

Assuming that the path that is passed will always be a valid path (in any format) we can modify the function to include 2 steps:

  1. Check if the path is a proper Windows Style path if so, return original path

  2. Extract only the <drive>/path/to/the/thing from the path provided and convert it into a valid Windows path

This way backwards compatibility will also be maintained, since this case covers the original case of /host_mnt/C/some/path

I will create a PR for this.

biplobmanna avatar Mar 04 '23 11:03 biplobmanna

any chance the PR can be merged?

I can manually modify the scripts and it works fine for me, but I'd want to pass this tool for my whole team and I'd hate to tell them to manually apply fix.

sergiu-enache avatar Jul 18 '23 11:07 sergiu-enache