I can not understand documentation of get_filename_component .
It describes:
NAME_WE = File name without directory or longest extension
NAME_WLE = File name without directory or last extension
What does it mean? If and was used here instead of or this would be what I want.
But what or means? It removes randomly one of this variants:
directory
longest extension
both: directory, longest extension
?
How it choose what to remove?
fenrir
(Jakub Zakrzewski)
June 11, 2020, 11:18am
2
This is how English grammar works (as a non-native speaker I love those details).
It means both.
The funny thing is with and it could also be interpreted wrongly as returning two things.
But the context is removing, not returning things. So with and it would be interpreted in the right way as removing two things?
ben.boeckel
(Ben Boeckel (Kitware))
June 11, 2020, 11:47am
4
I think without either the directory or the
may make it even clearer. Examples would help too.
1 Like
But it is nonsense remove just directory or just extension, NAME_WE
suggest that actually should be removed both. either
looks completly wrong?
ben.boeckel
(Ben Boeckel (Kitware))
June 11, 2020, 12:05pm
6
Hrm, yeah, it still is ambiguous parsing. English needs order of operations . Would with neither the directory nor the X extension
read more clearly?
hex
(hex)
June 11, 2020, 12:10pm
7
and if any
is used?
NAME_WE = File name without any directory or longest extension
NAME_WLE = File name without any directory or last extension
it would be read as “without any of these”.
fenrir
(Jakub Zakrzewski)
June 11, 2020, 12:10pm
8
There are many ways to put it. The original is correct and clear to me (in English you have to resolve parsing ambiguities in favour of the interpretation that makes the most sense).
“without” can also be used with “nor”
I don’t know if you could formulate it clearer than that.
1 Like
ben.boeckel
(Ben Boeckel (Kitware))
November 10, 2020, 3:09pm
9