Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g.filename: Create dir in mapset only when asked #1687

Merged
merged 2 commits into from
Jul 13, 2021

Conversation

wenzeslaus
Copy link
Member

The previous behavior is creating the corresponding directory in the current
mapset anytime the module is executed (the intention was anytime the path is
in the current mapset according to the doc).

Creating the directory makes sense given the intended use of the module
(notably, the module is used only in one v6 addon as of now).
Given that there is a distinction between creation of an element and file
(even when file is a directory), having the functionality in a module
allows for treating the element case in a special way (see #1681).

However, given the primary function of this module (constructing a path regardless of
its existence), writing operation is unexpected, so the new default is not writing
anything and creation needs to be explicitly requested using a new -c flag
which causes fatal error when the constructed path is not in the current mapset
(asking for creation of something outside of the current mapset is considered a usage error).

The previous behavior is creating the corresponding directory in the current
mapset anytime the module is executed (the intention was anytime the path is
in the current mapset according to the doc).

Creating the directory makes sense given the intended use of the module
(notably, the module is used only in one v6 addon as of now).
Given that there is a distinction between creation of an element and file
(even when file is a directory), having the functionality in a module
allows for treating the element case in a special way (see OSGeo#1681).

However, given the primary function of this module (constructing a path regardless of
its existence), writing operation is unexpected, so the new default is not writing
anything and creation needs to be explicitly requested using a new -c flag
which causes fatal error when the constructed path is not in the current mapset
(asking for creation of something outside of the current mapset is considered a usage error).
@wenzeslaus
Copy link
Member Author

@wenzeslaus wenzeslaus added the bug Something isn't working label Jul 13, 2021
@wenzeslaus wenzeslaus merged commit c0cda13 into OSGeo:master Jul 13, 2021
@wenzeslaus wenzeslaus deleted the no-mkdir-in-g_filename branch July 13, 2021 01:50
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
The previous behavior is creating the corresponding directory in the current
mapset anytime the module is executed (the intention was only when the path is
in the current mapset according to the doc).

Creating the directory makes sense in general given the intended use of the module
(get path for a file in mapset, possibly in order to create it).
Given that there is a distinction between creation of an element (dir) and file
(even when file is a directory), having the functionality in a module
allows for treating the element case in a special way (not implemented yet, but see OSGeo#1681).
However, notably, the module is used only in one v6 addon as of now.

However, given the primary function of this module (constructing a path regardless of
its existence), writing operation is unexpected, so the new default is not writing
anything and creation needs to be explicitly requested using a new -c flag
which causes fatal error when the constructed path is not in the current mapset
(asking for creation of something outside of the current mapset is considered a usage error).
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
The previous behavior is creating the corresponding directory in the current
mapset anytime the module is executed (the intention was only when the path is
in the current mapset according to the doc).

Creating the directory makes sense in general given the intended use of the module
(get path for a file in mapset, possibly in order to create it).
Given that there is a distinction between creation of an element (dir) and file
(even when file is a directory), having the functionality in a module
allows for treating the element case in a special way (not implemented yet, but see OSGeo#1681).
However, notably, the module is used only in one v6 addon as of now.

However, given the primary function of this module (constructing a path regardless of
its existence), writing operation is unexpected, so the new default is not writing
anything and creation needs to be explicitly requested using a new -c flag
which causes fatal error when the constructed path is not in the current mapset
(asking for creation of something outside of the current mapset is considered a usage error).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants