recursing subdirectories - redirector (Developers)
I have another question about this.
In order for the OS (not necessarily MSDOS) to free up resources,
if the user (ie programmer) wishes to terminate the FindNext
(original API) early, I was wondering how it could signal "close"
when "close" doesn't exist.
So if it was scanning a huge directory, and it found the file it
wanted, and now wishes to stop, I was thinking it could use
the same DTA that it is already using, and then issue a FindFirst
for a stupid filename, likely with silly attributes, which would
then return with failure, and then the OS knows that it can
discard any resources associated with this DTA as it is no
longer useful.
The same thing would occur normally, if FindNext is done until
the directory is exhausted.
Does this sound like a reasonable approach for the programmer
to take?
Any suggestions on the specifics of what filename/attributes
should be given to FindFirst to cause an early termination,
preferably guaranteed so that a FindNext loop isn't required
to ensure a logical termination.
One issue might be that a second FindFirst, used purely to
free up resources, may cause a massive scan of the directory
looking for the dummy filename.
Perhaps the root directory could be searched for this new
dummy FindFirst, but that would then open up the possibility
that a different OS has protection preventing the user from
reading the root directory. What about a FindFirst of NUL:?
Thanks. Paul.
Complete thread:
- recursing subdirectories - kerravon, 20.10.2025, 08:15 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- recursing subdirectories - ecm, 20.10.2025, 08:54
- recursing subdirectories - kerravon, 20.10.2025, 18:02
- recursing subdirectories - redirector - ecm, 20.10.2025, 20:30
- recursing subdirectories - redirector - ecm, 20.10.2025, 20:33
- recursing subdirectories - redirector - kerravon, 25.10.2025, 16:56
- recursing subdirectories - redirector - usotsuki, 25.10.2025, 18:15
- recursing subdirectories - redirector - kerravon, 26.10.2025, 03:22
- recursing subdirectories - redirector - Rugxulo, 26.10.2025, 03:34
- recursing subdirectories - redirector - kerravon, 23.11.2025, 18:04
- recursing subdirectories - redirector - Ringding, 27.11.2025, 08:36
- recursing subdirectories - redirector - kerravon, 27.11.2025, 12:38
- recursing subdirectories - redirector - Ringding, 27.11.2025, 08:36
- recursing subdirectories - redirector - kerravon, 26.10.2025, 03:22
- recursing subdirectories - redirector - usotsuki, 25.10.2025, 18:15
- recursing subdirectories - redirector - ecm, 20.10.2025, 20:30
- recursing subdirectories - kerravon, 20.10.2025, 18:02
- recursing subdirectories - ecm, 20.10.2025, 08:54
Mix view