You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File.Readdir takes an n parameter that specifies a maximum count to return ("If n > 0, Readdir returns at most n FileInfo structures."). However, I'm seeing more than n being returned when n is both 3 and 5 (and likely other values as well).
Your program has a race condition. There is no necessary connection between the print of "Batch!" and the print of the ENTRY lines, so there is no required order. It would be easy for you to prove your case: check the len of the value returned by Readdir directly, rather than doing it indirectly by looking at print statements.
I'm going to close this. If you are sure this is a bug, please provide a non-racy test case. Please also provide a complete standalone program, rather than portions of a larger program. Thanks.
File.Readdir
takes ann
parameter that specifies a maximum count to return ("If n > 0, Readdir returns at most n FileInfo structures."). However, I'm seeing more thann
being returned whenn
is both 3 and 5 (and likely other values as well).Channelizing the
File.Readdir
call:Using it:
With n = 3:
With n = 5:
The text was updated successfully, but these errors were encountered: