3 ms·
>bfs operates breadth-first, which typically finds the file(s) you're looking for faster. I find this statement very confusing. Typically I'm looking for file
by konart 3y ago
>bfs operates breadth-first, which typically finds the file(s) you're looking for faster.
I find this statement very confusing.
Typically I'm looking for files in subdirs because I'm not aware of target's path. That's depth first (though of couse there is a change I'm going to find my target quite close to the starting point).
And if I'm looking in the same dir I'm currently in (or I know what dir to look at) - then there is no need for a sophisticated search anyway, as typicall you don't have too many files in a directory unless this is some kind of tmp or cache directory.
- konart 3y agoI need some test vs fd.
- rowbin 3y agobreath-first doesn't mean it's not looking into subdirectories. It is, but it looks into each subdirectory before decending into the different subdirectories subdirectories. So it enger first subdir, looks at files there, then goes back up, enters second subdirectory, looks at files there, ... After checking each subdir it goes into the first subdir oft the first subdir, looks at files there, then goes to second subdir of first subdir