elevation icon indicating copy to clipboard operation
elevation copied to clipboard

mkdir -p not working on windows

Open chahank opened this issue 4 years ago • 5 comments

The elevation package can create problems on Windows machine because the command 'mkdir -p' does not work. It should be replaced by 'mkdir'. Recursivity (flag p) is natively included in 'mkdir' on Windows.

One quick and dirty solution would be to modify 'datasource.mk' and check if the OS is Windows, in which case the code should use 'mkdir' , else 'mkdir -p'.

Could the developers please comment whether there is any argument speaking against such a change?

chahank avatar Jul 07 '20 13:07 chahank

Is there still anyone active on this repository?

chahank avatar Jul 29 '20 12:07 chahank

I'm sorry the tools has been design to work on Linux/MacOS/Unix and I never tested it on Windows. It may work using the Windows Subsystem for Linux (WSL), but it is not supported.

alexamici avatar Jul 29 '20 14:07 alexamici

Thanks for the reply! That is what we figured out. We tested the package quite a bit also on Windows and found that:

  • make can be installed with conda
  • unzip can be globally installed with UnxUtils
  • mv dito
  • find dito, but the PATH must be set before the winows command find

However,

  • mkdir from UnxUtils won't work because option -p is ignored.

This could be easily solved by using mkir from windows directly, but this must be done without the -p flag (the windows mkdir applied the flag implicitly). Hence, a simple solution to make the package usable would be to add an if statement to use mkdir instead of mkdir -p when the system is windows.

chahank avatar Jul 29 '20 14:07 chahank

You might consider filing a bug with windows that it is not implementing the -p option which is required by POSIX: https://pubs.opengroup.org/onlinepubs/9699919799/

While that seems hard, it would probably make a lot of things work better on Windows if it were fixed.

gdt avatar Jul 29 '20 15:07 gdt

Thanks for the idea. However, I do not think this would quickly fix the problem (if it is done at all).

chahank avatar Jul 31 '20 08:07 chahank