Re:Bashing the Bash – Replacing Shell Scripts with Python (2...
by Izkata on Saturday March 26, 2022 @02:02AM
(#30809627)
My preferred way under those conditions would be more along the lines of "see if a safe command fails, do the desired command if not", like:
[ Parent
| on HN ]
Re:Bashing the Bash – Replacing Shell Scripts with Python (2...
by xorcist on Saturday March 26, 2022 @07:23AM
(#30810902)
That only looks simple because we don't know what problem was being solved.
Is it really right to not process any files just because one of them just disappeared?
In general, situations like this suffer from race conditions and time-of-check/time-of-use problems.
Re:Bashing the Bash – Replacing Shell Scripts with Python (2...
by Izkata on Saturday March 26, 2022 @03:41PM
(#30814731)
> Is it really right to not process any files just because one of them just disappeared?
No idea what you mean here, the glob can expand to one or many.
> In general, situations like this suffer from race conditions and time-of-check/time-of-use problems.
I mean, that's a problem in every version presented so far, one that I don't think can be fixed externally without something extra like hardlinking to a new directory, because "the_tool" apparently can't handle missing files and they can go missing when "the_tool" starts up. That's why I didn't even bother.