bopen / elevation

Python script to download global terrain digital elevation models, SRTM 30m DEM and SRTM 90m DEM.

Home Page:http://elevation.bopen.eu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mkdir -p not working on windows

chahank opened this issue · 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?

Is there still anyone active on this repository?

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.

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.

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.

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