elixir icon indicating copy to clipboard operation
elixir copied to clipboard

Elixir silently removes exclamation marks and reports no such file (Windows 10)

Open robss2020 opened this issue 1 year ago • 2 comments

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.15.7 (compiled with Erlang/OTP 26)

Operating system

Windows 10

Current behavior

Exclamation marks are silently removed from filenames, although they are allowed characters in Windows, and an error is reported.

To reproduce: save IO.puts("Hello, world!") as "hello world!.exs" and execute it with: elixir "hello world!.exs" It will fail with "no file named hello world.exs" (silently removing the exclamation mark). Also works without quotation marks as a single word (helloworld!.exs).

C:\test>elixir "hello world!.exs" No file named hello world.exs

image

image

Expected behavior

If it is legal in the operating system it should be accepted as an input file, or at least the error message should say "! is not allowed in filename" if it can't be run for some reason.

robss2020 avatar Dec 11 '23 00:12 robss2020

Thank you. I could easily reproduce the issue but it does not seem trivial to fix. I think we should rewrite our script to PowerShell, it should be both more maintainable and we could also test them on Unix as of PowerShell 7.

You may be able to run it as elixir "helloworld^!.exs" meanwhile.

josevalim avatar Dec 11 '23 08:12 josevalim

There is a failing test here: #13166

josevalim avatar Mar 22 '24 18:03 josevalim