Re:Fix the unit test and open a giant hole everywhere
by catern on Saturday December 25, 2021 @01:15AM
(#29680932)
I think the real fix here is to investigate why you're creating possibly-already-existing directories anyway. Most files or directories should either be owned by a specific component (which then creates them and fails if they already exist) or should be assumed to already exist (as a requirement that the environment is set up properly.
[ Parent
| on HN ]
Re:Fix the unit test and open a giant hole everywhere
by spc476 on Saturday December 25, 2021 @02:20AM
(#29681205)
It depends upon usage. My blogging software keeps entries in the file system, in a hierarchy as YYYY/MM/DD. I just create the directories as I add entries by doing a "mkdir(year); mkdir(year "/" month); mkdir(year "/" month "/" day)".