please avoid some special characters in file names
jfilak opened this issue · 5 comments
I know that the goal is to make it human readable but don't forget that we also want to write CI jobs where we have to use scripting.
Would it be possible to get rid of:
- white spaces
()
(sub-shell)$
(variables)!
(events)|
(pipes)<>
(output redirection)&
(run on background)/
(path delimiter on UNIX)\
(path delimited on Windows);
(shell token)- ` (sub-shell)
Example of OK characters:
+
*
(better to not use it because path globbing but still not dangerous for shell)=
_
.
~
@
:
,
(better to no use it because confusing)[]
{}
- and . are also dangerous.
We also have to avoid characters that are allowed in object names.
BTW: I like the (brackets) to encode the slash around /namespaces/ :-)
AFF specification so far: https://github.com/SAP/abap-file-formats/blob/main/docs/specification.md#file-names
For reserved characters see also: https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words
Thank you @jfilak for your feedback. I understand your use case.
However, as of now, I think I tend to keep the brackets/parenthesis (()
) for objects with namespaces, because it's the best readable alternativ from my point of view. We could use other characters for name spaces, but they might lead to issues in other scenarios.
In any case we need to avoid following characters (as also mentioned by @ulrichauer):
_
Is heavily used by ABAP object names (further characters I found in object names often are-
,=
)- We also shouldn't use
*
,.
or:
Gentlemen, period .
is one of the most commonly used character and it is super OK to use it in file name. Why do you think we should not use it?
The only problem with asterisk is that shell could match a glob pattern which in the worst case leads to an error from the shell. So the verdict would be it is OK but use it only if no other option.
I do not get why do you think colon :
and underscore _
are dangerous characters?
The brackets ()
are super dangerous because shells tends to execute the contents in a sub-shell. If you really need to use brackets then use curly braces {}
or squar braces ()
which does not cause problems in shells.
I do not get why do you think colon : and underscore _ are dangerous characters?
@jfilak Of course : and _ are not dangerous. But they are widely used in object names, so they are not suited as substitute for the namespace delimiters.