T
tshad
I have a program that pulls files out of a zip file for processing. The
program has ran through tens of thousands of files without any problem.
I am on a new project where I use the same code to do essentially the same
thing and it works much of the time. But we are getting corrupted files
that don't seem corrupted a bunch of times. We couldn't figure out why some
files work fine and some didn't. We are using Winzip and all the users are
doing it the same way.
I have a FileWatcher watching a folder that these files are dropped into.
The first think I do is try to extract the necessary files. But when I have
the error, it is when trying to set up the instance of the class:
public class ZipFiles
{
// The ZipFile object is a Java object so you will need the Java
Libraries and you will need to reference vjslib library
public static void Extract(string zipFileName, string
destinationPath)
{
ZipFile zipfile = null;
try
{
zipfile = new ZipFile(zipFileName);
}
catch(Exception exc)
{
throw new Exception("File: " + zipFileName + " Corrupted ",
exc);
}
finally
{
if (zipfile != null)
{
zipfile.close();
}
else
System.GC.Collect();
}
As you can see, all I am doing is instantiating the ZipFile class and
passing the file. If it can't, it thows an exception.
The only thing we can determine is that if we copy the file into the folder,
it works fine.
If we drag the file directly to the folder, we get the error. When we drag
it we are doing a move and not a copy so it is a copy/paste.
I have now idea why a "Move" would fail and "Copy" would not. It is the
same file.
Any idea what could cause this?
Thanks,
Tom
program has ran through tens of thousands of files without any problem.
I am on a new project where I use the same code to do essentially the same
thing and it works much of the time. But we are getting corrupted files
that don't seem corrupted a bunch of times. We couldn't figure out why some
files work fine and some didn't. We are using Winzip and all the users are
doing it the same way.
I have a FileWatcher watching a folder that these files are dropped into.
The first think I do is try to extract the necessary files. But when I have
the error, it is when trying to set up the instance of the class:
public class ZipFiles
{
// The ZipFile object is a Java object so you will need the Java
Libraries and you will need to reference vjslib library
public static void Extract(string zipFileName, string
destinationPath)
{
ZipFile zipfile = null;
try
{
zipfile = new ZipFile(zipFileName);
}
catch(Exception exc)
{
throw new Exception("File: " + zipFileName + " Corrupted ",
exc);
}
finally
{
if (zipfile != null)
{
zipfile.close();
}
else
System.GC.Collect();
}
As you can see, all I am doing is instantiating the ZipFile class and
passing the file. If it can't, it thows an exception.
The only thing we can determine is that if we copy the file into the folder,
it works fine.
If we drag the file directly to the folder, we get the error. When we drag
it we are doing a move and not a copy so it is a copy/paste.
I have now idea why a "Move" would fail and "Copy" would not. It is the
same file.
Any idea what could cause this?
Thanks,
Tom