at my job we use this method for an automated job that is trigger when .7zip files are put inside a specific folder:
public void Executer(ref string pChaineContexte, XdCuContexteTravail pContexte)
{
var dossierDepot = new XdCuFichier().ObtenirDepot(ref pChaineContexte, pContexte.NomChaine(ref pChaineContexte), "ReceptionSEEL");
string[] fichiersZip = Directory.GetFiles(dossierDepot);
foreach (var fichierZip in fichiersZip)
{
var fichierVide = string.Concat(dossierDepot, "\\", Path.GetFileNameWithoutExtension(fichierZip));
Directory.CreateDirectory(fichierVide);
using (var archive = ArchiveFactory.Open(fichierZip))
{
foreach (var entry in archive.Entries)
{
if (!entry.IsDirectory)
entry.WriteToDirectory(fichierVide, new ExtractionOptions() { ExtractFullPath = true, Overwrite = true });
}
}
}
return;
}
The problem is that I get a lot of the time this error: "File does not have a stream". It does start the decompressing job but there is only one file that is in the new folder and nothing more. After we get the error that I mentionned.
I've read this: Issue partially extracting a 7-Zip archive using SharpCompress and I think this is a real issue.
How do you think I should change my code?
lang-cs
Path.Combine.NotifyFilters.LastWritefilter. See this question