B
Boogum.com
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.
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.