468,768 Members | 1,397 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,768 developers. It's quick & easy.

Recursive search for files and out of stack error

For recursive search for files, like
http://support.microsoft.com/default...B;EN-US;306666, it may
lead to "out of stack" error if searching too many files, say millions
of files.
Do you all experts have any solution for this situation?

Sep 6 '05 #1
3 1406
al****@gmail.com wrote:
For recursive search for files, like
http://support.microsoft.com/default...B;EN-US;306666, it may
lead to "out of stack" error if searching too many files, say millions
of files.
Do you all experts have any solution for this situation?


It should not have any impact on wether you get "stack overflow"
exceptions or not how many files you are finding.

However, the depth of your directory search might have that effect, but
the only way I can think of that you can get such problems with this is
if you've managed to create directory links (symlinks) to parent
directories... In other words, that C:\Temp contains a directory Test
which contains a symlink back to \Temp, which contains Test, which
contains a symlink back to \Temp, which ... well, you get the picture.

If you have experienced a stack problem with the given code, please post
the circumstances.

--
Lasse Vågsæther Karlsen
http://www.vkarlsen.no/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2
Sep 6 '05 #2
Hi Lasse,

Thanks for your response. Depth of directoris does matter but I don't
think it is possible to create symlinks in NTFS. I think the reason is
that parameters of MS's recursive search is only one, sDir.
Sub DirSearch(ByVal sDir As String)
while that of my rescursive search is too many:
Public Function LoadFiles( _
ByVal sFileSpec As String, _
minSz As Long, _
maxSz As Long, _
ProtectDir As Object, _
AnyExclusion As Boolean, _
Optional ByVal bRecursive As Boolean = False, _
Optional ByVal ModDate As String = "", _
Optional ByVal bHidden As Boolean = False, _
Optional ByVal bSrchTarget As Boolean = True, _
Optional ByRef pb = Nothing) _
As Long

What do you think?

Alan

Lasse Vågsæther Karlsen wrote:
al****@gmail.com wrote:
For recursive search for files, like
http://support.microsoft.com/default...B;EN-US;306666, it may
lead to "out of stack" error if searching too many files, say millions
of files.
Do you all experts have any solution for this situation?


It should not have any impact on wether you get "stack overflow"
exceptions or not how many files you are finding.

However, the depth of your directory search might have that effect, but
the only way I can think of that you can get such problems with this is
if you've managed to create directory links (symlinks) to parent
directories... In other words, that C:\Temp contains a directory Test
which contains a symlink back to \Temp, which contains Test, which
contains a symlink back to \Temp, which ... well, you get the picture.

If you have experienced a stack problem with the given code, please post
the circumstances.

--
Lasse Vågsæther Karlsen
http://www.vkarlsen.no/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2


Sep 19 '05 #3
Hi Lasse,

Thanks for your response. Depth of directoris does matter but I don't
think it is possible to create symlinks in NTFS. I think the reason is
that parameters of MS's recursive search is only one, sDir.
Sub DirSearch(ByVal sDir As String)
while that of my rescursive search is too many:
Public Function LoadFiles( _
ByVal sFileSpec As String, _
minSz As Long, _
maxSz As Long, _
ProtectDir As Object, _
AnyExclusion As Boolean, _
Optional ByVal bRecursive As Boolean = False, _
Optional ByVal ModDate As String = "", _
Optional ByVal bHidden As Boolean = False, _
Optional ByVal bSrchTarget As Boolean = True, _
Optional ByRef pb = Nothing) _
As Long

What do you think?

Alan

Lasse Vågsæther Karlsen wrote:
al****@gmail.com wrote:
For recursive search for files, like
http://support.microsoft.com/default...B;EN-US;306666, it may
lead to "out of stack" error if searching too many files, say millions
of files.
Do you all experts have any solution for this situation?


It should not have any impact on wether you get "stack overflow"
exceptions or not how many files you are finding.

However, the depth of your directory search might have that effect, but
the only way I can think of that you can get such problems with this is
if you've managed to create directory links (symlinks) to parent
directories... In other words, that C:\Temp contains a directory Test
which contains a symlink back to \Temp, which contains Test, which
contains a symlink back to \Temp, which ... well, you get the picture.

If you have experienced a stack problem with the given code, please post
the circumstances.

--
Lasse Vågsæther Karlsen
http://www.vkarlsen.no/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2


Sep 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Bill Borg | last post: by
3 posts views Thread by Robertico | last post: by
13 posts views Thread by jm.suresh | last post: by
9 posts views Thread by Lloyd Sheen | last post: by
10 posts views Thread by pereges | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.