473,467 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1567
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Victor | last post by:
Hello, I've got a situation in which the number of (valid) recursive calls I make will cause stack overflow. I can use getrlimit (and setrlimit) to test (and set) my current stack size. ...
14
by: BQ | last post by:
Due to a lack of resources, I have to translate the following recursive function in its iterative form. It's a kind of dichotomic search. void SearchSlaves(unsigned long start_uid, unsigned long...
9
by: Bill Borg | last post by:
Hello, I call a function recursively to find an item that exists *anywhere* down the chain. Let's say I find it five layers deep. Now I've got what I need and want to break out of that whole...
3
by: alanwo | last post by:
For recursive search for files, like http://support.microsoft.com/default.aspx?scid=KB;EN-US;306666, it may lead to "out of stack" error if searching too many files, say millions of files. Do you...
3
by: Ameen | last post by:
I am very new to programming and VB.net, and I wrote the code below, but it seem to go on an infinite loop. Please tell me what I am doing wrong. Private Sub search(ByVal indexstart) Pos1 =...
3
by: Robertico | last post by:
I'am new to php and have a question about a recursive file search. I'd like to do a recursive search for jpg-files and add the filenames (full path) to a mysql database. I appreciate any help ! ...
13
by: jm.suresh | last post by:
Hi, I have a program which literately finds the object that overlapping a point. The horizontal and vertical search are called recursively from inside each other. Is this way of implementation...
9
by: Lloyd Sheen | last post by:
For all those who don't think that a recursive search of files in folders is a good thing in the Microsoft.VisualBasic.FileIO.FileSystem namespace listen to this. I am reorg my mp3 collection. ...
10
by: pereges | last post by:
How to to go about this ? Suppose a malloc inside a recursive function has failed and you want to set the error flag and return it to the calling function(the one which called the recursive...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.