#Windows paths - Part 2 (RESOLVED)
1 messages · Page 1 of 1 (latest)
Previously, we checked against C:/ C:\ and .\ on windows, but ~ is also a valid way to get to a users home dir and probably common with scripts and such if people are calling dagger from a shell on Windows
right, same on Unix/Linux for home dir, how do you see this cropping up and causing issue, @thick oxide ?
With the installer or more generally?
here's an example
dagger -m github.com/pjmagee/dagger-heroes-decode@6c672139c5a5d5138ae608cd33af707c45a833c9 call decode --file='~.\2024-06-04 17.49.26 Hanamura Temple.StormReplay' stdout
I nthis case, my current director, is not relevant. I'm using ~ to say, this is basically the absolute path + .\ of the file in my home dir
this is what is output from dagger cli
✘ Host.file(path: "C:/Projects/pjmagee/Dota2Helper/~/2024-06-04 17.49.26 Hanamura Temple.StormReplay"): File! 0.0s
! select: host directory C:/Projects/pjmagee/Dota2Helper/~/: rpc error: code = Unknown desc = resolve : CreateFile C:\Projects\pjmagee\Dota2Helper~: The system cannot find the file specified.
Error: response from query: input: host.file resolve: select: host directory C:/Projects/pjmagee/Dota2Helper/~/: rpc error: code = Unknown desc = resolve : CreateFile C:\Projects\pjmagee\Dota2Helper~: The system cannot find the file specified.
It's picking up my "current working directory" C:/Projects/pjmagee/Dota2Helper and then combined that with the ~ home dir
A 'workaround'? But not really, since its powershell just patching it.
dagger -m github.com/pjmagee/dagger-heroes-decode@6c672139c5a5d5138ae608cd33af707c45a833c9 call decode --file "$HOME.\2024-06-04 17.49.26 Hanamura Temple.StormReplay" stdout
This worked fine, but that's because Powershell was used with $HOME which evaluated it correctly
Hmm, actually now i am wondering if im wrong
I think ~ is a Powershell specific alias
Doing a bit of googling, because im sure ive been using ~ for docker-compose and such things. So im trying to figure out of its a user issue, or something that dagger should support
right now im convinced the CLI tool should understand ~ on Windows and it doesnt seem to understand that.
If you can create an issue on GitHub, that would be grand, but otherwise, I'll check back and create one.
I'll raise an issue and then feel free to add or change as required
C:\Users\patri> docker run -it -v $HOME/mount/:/usr/home alpine:latest cat /usr/home/hello.txt
HELLO
C:\Users\patri> docker run -it -v ~/mount/:/usr/home alpine:latest cat /usr/home/hello.txt
cat: can't open '/usr/home/hello.txt': No such file or directory
Doesnt look like ~ works with volume mounting, but I guess the docker compose may have had supported added to it. I didnt check docker compose yet with an example. But also this is a different problem.
dagger supports files, where as docker only supports volumes, but they're also completely different tools. Dagger is uploading the file to the engine. So maybe my 'devils advocate' to not support such a case.
@terse sequoia 👆
I see Sama's response so now im not convinced its a bug.
I think the shell is interpreting the ~ and the experience is very smooth, but this doesnt mean the shell experience is something that dagger should recognise.
Yep, best way to work with this is just using $HOME if using powershell.
And using something like git bash (MINGW64) on windows, this also works:
dagger -m github.com/pjmagee/dagger-heroes-decode@6c672139c5a5d5138ae608cd33af707c45a833c9 call decode --file ~/simple.StormReplay stdout