Skip Menu |

This queue is for tickets about the File-Util CPAN distribution.

Report information
The Basics
Id: 67399
Status: rejected
Priority: 0/
Queue: File-Util

People
Owner: Nobody in particular
Requestors: ahernit [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.27
Fixed in: (no value)



Subject: max_dives does not work correctly
Hello, I assume max_dives should limit the depth of diving into subdirectotry like 1/2/3/4/5/6/..deeper.. It this is your intention, It does not do like that. Ive got a very flag but very large dir with ca 350000 folders and it stops scanning it early. I think the bug is the line if (scalar keys %{ $this->{'traversed'} } >= $maxd) { and around. Because it only counts the number of parent dirs found. But if this is what it should do, why cant I disable maxdive? Or just return what found so far. Maybe a limitation by time makes more sense. best regards.
You are correct that max_dives is not the same as max_depth. max_depth is not something that is currently implemented, but I'll take it into consideration. What I can promise you is that I will provide you with a way to disable max_dives completely in the next version (3.30). In the future, if you set max_dives to zero (0), File::Util will ignore the max_dives directive. Please understand that max_dives is a mechanism to protect you from creating programs with File::Util that run your computer system completely out of memory/resources or case it to "lock up" and become unresponsive; list_dir() does not stream back results; instead they are returned in the form of a list. As such, a huge directory or directory tree would amount to a list of immense size. Such a list could potentially increase to a length that consumes all available memory. Using max_dives allows you to set a threshold that helps limit the size of the results you get back from list_dir(). And now, because max_dives DOES behave as intended and as documented, this bug is being rejected as invalid. However you do have my assurance that I will provide you with a way to disable max_dives in the next release of File::Util in the coming weeks.