Closed IldarKhayrutdinov closed 1 year ago
This is a C++11 library so I don't want to use anything not available there officially. And I don't want to get into the problem of having std::experimental::filesystem
vs. std::filesystem
. There must have been a way to do this check in Windows before we got std::filesystem
?
@joto Sure, I'll try now. Done.
@joto I'll later implement without includes, as https://github.com/dotnet/runtime/blob/174e04336e4a073416cb0baebb2be72728b9d64b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs#L271
UPD Done
@joto I don't understand why the build fails, did you looked at the latest revision?
Thank you for your patience :)
Yes, I have tested on Windows:
Absolute path:
c:\temp>osmium extract test.osm -p C:\temp\subdir\regions.geojson -o out.osm
[======================================================================] 100%
Relative paths:
c:\temp>osmium extract test.osm -p subdir\regions.geojson -o out.osm -O
[======================================================================] 100%
c:\temp>osmium extract test.osm -p ./subdir\regions.geojson -o out.osm -O
[======================================================================] 100%
c:\temp>osmium extract test.osm -p .\subdir\regions.geojson -o out.osm -O
[======================================================================] 100%
c:\temp>osmium extract test.osm -p ..\temp/subdir\regions.geojson -o out.osm -O
[======================================================================] 100%
These cases should be used with caution with the config file, there may be confusion:
A relative path from the current directory of the C: drive:
c:\temp>osmium extract test.osm -p C:subdir\regions.geojson -o out.osm -O
[======================================================================] 100%
A relative path from the root of the current drive:
c:\temp>osmium extract test.osm -p /temp/subdir\regions.geojson -o out.osm -O
[======================================================================] 100%
https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#traditional-dos-paths
Thank you @IldarKhayrutdinov !
On
Windows
I get an error when using absolute path forpolygon
:Relative path works fine:
This PR is fixes for this bug.
I hope it's the correct to use<experimental/filesystem>
.