R
Rogelio
hey, got a method here (that I took from somewhere) that gets a list of all
the files in a folder.,
/// <summary>
/// Method that gets all the files in a directory and returns an
arraylist of all the files.
/// </summary>
/// <param name="di">Directory Info Object</param>
/// <param name="searchPattern">Search Pattern (*.pdf)</param>
/// <param name="MyFiles">referenced array list</param>
private void GetFiles(DirectoryInfo di, string searchPattern, ref
ArrayList MyFiles)
{
foreach (FileInfo fi in di.GetFiles(searchPattern))
{
MyFiles.Add(fi.FullName);
}
// comment out the following to not Search in subdirctories
foreach (DirectoryInfo d in di.GetDirectories())
{
GetFiles(d, searchPattern, ref MyFiles);
}
}
the problem is sometimes people are going to be pasting massive ifles in
this folder., like 100+ MB of size. and as you know it will put the file
there, but it wont be done yet.
what kind of "if" statement do I need that checks the file's status that its
not currently being written to?
thanks,
the files in a folder.,
/// <summary>
/// Method that gets all the files in a directory and returns an
arraylist of all the files.
/// </summary>
/// <param name="di">Directory Info Object</param>
/// <param name="searchPattern">Search Pattern (*.pdf)</param>
/// <param name="MyFiles">referenced array list</param>
private void GetFiles(DirectoryInfo di, string searchPattern, ref
ArrayList MyFiles)
{
foreach (FileInfo fi in di.GetFiles(searchPattern))
{
MyFiles.Add(fi.FullName);
}
// comment out the following to not Search in subdirctories
foreach (DirectoryInfo d in di.GetDirectories())
{
GetFiles(d, searchPattern, ref MyFiles);
}
}
the problem is sometimes people are going to be pasting massive ifles in
this folder., like 100+ MB of size. and as you know it will put the file
there, but it wont be done yet.
what kind of "if" statement do I need that checks the file's status that its
not currently being written to?
thanks,