DaemonMode.jl icon indicating copy to clipboard operation
DaemonMode.jl copied to clipboard

Passing paths as ARGS on Windows

Open SteffenPL opened this issue 4 years ago • 3 comments

The following script doesn't work on my computer

# script.jl
println(ARGS)
julia --project --startup-file=no -e "using DaemonMode; runargs()" .\script.jl "D:\w"
PAUSE

The error message is

ERROR: ERROR: MethodError: no method matching (::Colon)(::Int64, ::Nothing)

Whereas this is fine

julia --project .\script.jl "D:\w"
PAUSE

It seems that DaemonMode tries to process the ARGS and has problems with the windows path delimiters ''?

SteffenPL avatar Aug 31 '21 09:08 SteffenPL

As a workaround, one could use

julia --project=. --startup-file=no -e "using DaemonMode; ARGS .= replace.(ARGS, '\\' => '/'); runargs()" .\scripts\show_video.jl "D:\w"

Which is of course not really a good solution.

SteffenPL avatar Aug 31 '21 09:08 SteffenPL

Thank you for your issue. I have been checking it, and the problem is the "\" in the PATH, because when it is sent from the client to the server the "\w" is updated to "\w", giving that error. I will try to fix it in a few days.

dmolina avatar Sep 01 '21 19:09 dmolina

Hi @dmolina, thanks for the quick reply.

I also noticed also that spaces in paths are also tricky to pass. It seems that during the socket communication those also get split into different arguments, independent of quotes.

(Anyway, both things are easy to work around so far.)

SteffenPL avatar Sep 01 '21 19:09 SteffenPL