P
Peter Strøiman
Hi.
I have an application that iterates through the file system of a file
server.
The application uses the classes DirectoryInfo and FileInfo to iterate
through
e.g.
void iterate( DirectoryInfo dir )
{
foreach ( DirectoryInfo subDir in dir.GetDirectories() )
{
iterate( subDir );
}
foreach ( FileInfo file in dir.GetFiles() )
{
doSomething ( file );
}
}
This takes quite a bit of time, when I have approx. 4Gb of data (many small
files)
Any ideas how I can speed it up?
I'm not an expert on code permission and security attributes. Are there any
attributes I can set in my program that would bypass code permission checks
( and only make them when starting up the app? )
Or are there quicker ways of obtaining the list of files and directories on
the server?
Thanks in advance,
Peter Strøiman
I have an application that iterates through the file system of a file
server.
The application uses the classes DirectoryInfo and FileInfo to iterate
through
e.g.
void iterate( DirectoryInfo dir )
{
foreach ( DirectoryInfo subDir in dir.GetDirectories() )
{
iterate( subDir );
}
foreach ( FileInfo file in dir.GetFiles() )
{
doSomething ( file );
}
}
This takes quite a bit of time, when I have approx. 4Gb of data (many small
files)
Any ideas how I can speed it up?
I'm not an expert on code permission and security attributes. Are there any
attributes I can set in my program that would bypass code permission checks
( and only make them when starting up the app? )
Or are there quicker ways of obtaining the list of files and directories on
the server?
Thanks in advance,
Peter Strøiman