I am currently working on a software (not designed by me) that creates a file inside a specific, very deep, directory tree.
Let’s say that the file name is 00112233445566778899.txt
The program creates a set of directories 00/11/22/33/44/55/66/77/88/99/ where the file is saved. To do so Qt libraries are used. For example QDirIterator is used to iterate through the directories.
Apparently, there is no particular reason for doing this.
So I was asking myself if creating just a single folder (hence 00112233445566778899/00112233445566778899.txt) wouldn’t be a better approach.
In general, do you think that there is any difference in performance between:
- creating a single directory, w.r.t. create the whole directory tree?
- entering a single directory to read the file, w.r.t. traversing the whole directory tree?
3