Skip to content

[Bug] Unix to Windows Portability bug in g.tempfile #3296

@girishnand

Description

@girishnand

Describe the bug
g.tempfile on Windows 11 generates the following input/output -

g.tempfile pid=235123 --verbose
<LOCATION><MAPSET>.tmp/unknown\235123.0

To Reproduce
As above.

Expected behavior
Windows file paths should use backward and not forward slashes.

System description (please complete the following information):

  • Operating System:
    Windows 11

  • GRASS GIS version -

g.version
GRASS 8.3.dev (2023)
(Tue Dec 12 00:33:01 2023) Command finished (0 sec)

Additional context
The bug can be traced to line 166 of file grass\lib\gis\tempfile.c in the function G__temp_element(), which uses '/' where HOST_DIRSEP would perhaps be more appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions