So after learning about DFS and BFS yesterday in my class I was curious as to how is scanning on various file system being done. I spent quite a bit of time trying to look for some references on the web, but so far I have failed in doing so. I'm assuming that either DFS or BFS are behind the core scanning in some file systems.There's also Dijkstra's algorithm but as I'm not even sure if file system is a weighted or unweighted tree (ie. number of files being the weight or file size) it's hard to say if it's useful or not because I believe that BFS would be better than Dijkstra if it's unweighted tree.I hope that someone could clear this up as there just isn't anything specific about it on the web.
What type of an algorithm is being used for directory structure scanning?
operating systems;search algorithms;filesystems
For most file systems, a directory lists its entries in a certain order, so reading (scanning) an individual directory will return its entries in that order.But when it comes to scanning whole directory structures, there is no such thing as core scanning: there isn't a common implementation for that.I think depth-first is more popular; e.g. GNU find only supports depth-first scanning.  This may be due to depth-first scanning consuming less memory on average; it can't be due to breath-first search being harder to implement, as it's just a matter of treating your list of files to visit as a queue rather than a stack.