473,396 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

BSoD using DirectoryInfo.Create() or FileInfo.MoveTo() in Console Application

All--

I've written a small console application to replace an old DOS batch
file that periodically takes all of the files out of a source
directory and breaks them up into a number of subdirectories in a
target directory. (The purpose of this application and the DOS batch
file before it is to keep a directory on an FTP server from filling up
with more files than it can handle.)

For some reason, I get a bluescreen whenever I run this application on
any directory with more than a few hundred files. Here is the section
of the code I believe is the most likely source of this error:

For iter = 0 To iTotalFileCount - 1
If iter Mod iFileCount = 0 Then
Do

iSubDirCount += 1
diThisSubDirectory = New
DirectoryInfo(diTarget.FullName & "\" & _
iSubDirCount.ToString("00000"))
Loop While diThisSubDirectory.Exists()
If diTarget.GetDirectories.GetUpperBound(0) +
1 >= 32767 Then
Console.WriteLine("Target directory full.
Operation aborted.")
Return
Else

Console.WriteLine("Creating " &
diThisSubDirectory.FullName)
diThisSubDirectory.Create()
'diThisSubDirectory.Refresh()
End If
End If

flSource(iter).MoveTo(diThisSubDirectory.FullName( ) & "\" &
flSource(iter).Name())
'flSource(iter).Refresh()
'diThisSubDirectory.Refresh()
Next

Has anyone seen this behavior before? I've run the code both with and
without the .Refresh() calls you see that are commented out.

TIA for any light y'all can shed on this error.

--Jekke
==
To e-mail me, deobfuscate jekkeATinsidejokeDOTtv.
Nov 20 '05 #1
6 3388
Hi Boogum,

I write a test sample and can not reproduce the problem.
Here is my code.

'----------------------------------code
begin------------------------------------------------------------------
Imports System
Imports System.IO
Module Module1
Sub Main()
Dim iter, iTotalFileCount, iSubDirCount As Integer
iTotalFileCount = 500
'===============Create test file====================================
Dim sw As StreamWriter
Dim i As Integer
For i = 1 To iTotalFileCount
sw = New StreamWriter("D:\temp\" + i.ToString("00000") + ".txt")
sw.WriteLine(Now.ToString() + i.ToString("00000"))
sw.Close()
Next
'===============Create test file====================================
'Create directory and move files
Dim diThisSubDirectory As DirectoryInfo
Dim src, des As String
For iter = 1 To iTotalFileCount
Try
diThisSubDirectory = New DirectoryInfo("C:\temp\A" +
iter.ToString("00000"))
diThisSubDirectory.Create()
src = "D:\temp\" + iter.ToString("00000") + ".txt"
des = diThisSubDirectory.FullName + "\" +
iter.ToString("00000") + ".txt"
File.Move(src, des)
Console.WriteLine("Move File " + src + " To" + des + "
Successful")
Catch e As Exception
Console.WriteLine(e.ToString)
End Try
Next
End Sub
End Module
'----------------------------------code
end---------------------------------------------------------------------

To troubleshoot the problem, you may try to use the try-catch to handle the
exception.
Since you will encounter blue screen, you may try to write some log into
disk file.
So that when you get blue screen, you can scan the log file to locate what
cause the blue screen.
You may try to log the time, calling method and the current move file and
directory.

If you have any concern on this issue, please post here.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #2
"Boogum.com" <bo****@nospam.not> schrieb
For some reason, I get a bluescreen whenever I run this application
on any directory with more than a few hundred files. Here is the
section of the code I believe is the most likely source of this
error:


The bluescreen doesn't give more information on the error?
Often recommended: http://www.memtest86.com/
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
On Fri, 5 Dec 2003 13:37:08 +0100, "Armin Zingler"
<az*******@freenet.de> wrote:
"Boogum.com" <bo****@nospam.not> schrieb
For some reason, I get a bluescreen whenever I run this application
on any directory with more than a few hundred files. Here is the
section of the code I believe is the most likely source of this
error:


The bluescreen doesn't give more information on the error?


Just a cryptic hex-based error code and a cryptic hex-based memory
address.

It looks like I'm going to have to do more testing. I'll make note of
any additional error information.

--Jekke
==
To e-mail me, deobfuscate jekkeATinsidejokeDOTtv.
Nov 20 '05 #4
On Fri, 5 Dec 2003 13:37:08 +0100, "Armin Zingler"
<az*******@freenet.de> wrote:
"Boogum.com" <bo****@nospam.not> schrieb
For some reason, I get a bluescreen whenever I run this application
on any directory with more than a few hundred files. Here is the
section of the code I believe is the most likely source of this
error:


The bluescreen doesn't give more information on the error?


Here's the bluescreen information:

*** STOP 0x000000C2 (0x00000099m, 0xE134B008, 0x00000000, 0x00000000)
BAD_POOL_CALLER

This means nothing to me. Does it mean anything to you?

--Jekke
==
To e-mail me, deobfuscate jekkeATinsidejokeDOTtv.
Nov 20 '05 #5
"Boogum.com" <bo****@nospam.not> schrieb
On Fri, 5 Dec 2003 13:37:08 +0100, "Armin Zingler"
<az*******@freenet.de> wrote:
"Boogum.com" <bo****@nospam.not> schrieb
For some reason, I get a bluescreen whenever I run this
application on any directory with more than a few hundred files.
Here is the section of the code I believe is the most likely
source of this error:


The bluescreen doesn't give more information on the error?


Here's the bluescreen information:

*** STOP 0x000000C2 (0x00000099m, 0xE134B008, 0x00000000,
0x00000000) BAD_POOL_CALLER

This means nothing to me. Does it mean anything to you?


no. :-/ That's the full message? No driver information or similar?
..... I found this one:
http://support.microsoft.com/default...&Product=winxp

--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6
Hi Boogum,

Did you try my test code in my last post?
This will help us to isolate the problem, I will appreciate your efforts.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: G. Richard Bellamy | last post by:
I'm trying to unset the Encrypted attribute on all the files in a path. The attribute is not getting set. What am I doing wrong? Perhaps there's another newsgroup I can send this to? Here's...
1
by: Vagabond Software | last post by:
I am recursing through ALL folders and sub-folders below a certain level to list all the files of a certain type in those folders. I use two ArrayLists, alFiles and alFolders, to track matching...
1
by: siddharth_jain_1 | last post by:
Hello I am trying to get a list of shared files and subdirectories in a particular folder on a server. For this I am using DirectoryInfo in the following way. DirectoryInfo folder = new...
3
by: xenophon | last post by:
This following innocuous code: System.IO.DirectoryInfo fff = new System.IO.DirectoryInfo(); System.IO.FileInfo ppp = fff.GetFiles( Request.MapPath(".") ); for( int ccc=0 ; ccc < ppp.Length ;...
1
by: Dominic Marks | last post by:
Hello Group, I'm bemused as to why this code isn't working. It's a very simple loop over the array of FileInfo objects returned from DirectoryInfo.GetFiles. It works fine until the eigth...
5
by: mrkbrndck | last post by:
Please see the code below as I am trying to use multithreading for copying files to a new location in a way that improves performance of the client windows application. The problem occurs when 2...
2
by: rn5a | last post by:
Using the FileSystemInfo class, I am retrieving all the directories & files existing in a particular directory on the server & listing them in a ListBox. If an item in the ListBox happens to be a...
5
by: Tom P. | last post by:
I am having the following problem: I create a FileSystemWatcher and wait for events. When the event does happen I refresh a FileSystemInfo list and set properties accordingly (IsFile, IsDir,...
0
by: nagashree | last post by:
Hi, i want to compress the file or directory i am able to do that can anybody help me to decompress the file when i double click on the zipped file i am getting the error message as...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.