Re:I Accidentally Deleted 7TB of Videos Before Going to Prod...
by XorNot on Thursday May 05, 2022 @09:03AM
(#31272781)
At the point you're doing this, you should be using a proper programming language with better defined string handling semantics though. In every place it comes up you'll have access to Python and can call the unlink command directly and much more safely - plus a debugging environment which you can actually step through if you're unsure.
[ Parent
| on HN ]
Re:I Accidentally Deleted 7TB of Videos Before Going to Prod...
by zrail on Thursday May 05, 2022 @02:38PM
(#31276985)
Eh, I think that misses the point a bit. Use whatever you want to generate the output, but make the intermediary structure trivial to inspect and execute. If you're actually taking the destructive actions within your complicated* logic then there's less room to stop, think, and test.
You could always generate an intermediary set, inspect/test/etc, and then apply it with Python. I've done that too, works just as well. The important thing is to separate the planning step from the apply step.
* where "complicated" means more complicated than, for ex, `rm some_path.txt` or `DELETE FROM table WHERE id = 123`.