I am using SharpZipLib in my application to Unzip files. I have a folder in which the zip is copied and is extracted there itself. ZIP and Folder name is a guid. Folder mostly contains 1 or 2 XML files of size 45kb on an average.
Following is the SAN storage where we store all the files (its not exact):
\\sharableFolder\Folder1\Folder2\Folder3
Few days ago errors were logged. The following error was logged continuously whenever unzip operation was performed:
An attempt was made to create more links on a file than the file system supports
We googled about this issue and we found following links:
https://msdn.microsoft.com/en-us/library/cc231199.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms681383
But we did not find help to resolve it.
We checked:
Limit of files and folders a Folder can contain
For FAT : Maximum number of files in a single folder: 65,534
For NTFS : Maximum number of files in a single folder: 4,294,967,295
We assumed that there is an issue with the no of ZIP files. Currently there are total 1,31,760 files (Zip and Folders) present. We created 1,00,000 ZIP files and also extracted same no of files using ICSharpZipLib. So in total there were 2,00,000 files in a folder. Our assumption that a folder can not contains 1,31,760 files was failed.
We tried alternate code to unzip file. That also didn't work.
We checked for path whether its too long. But that is also not the case.Path was in limit.
We tried moving out few thousand files. But this solution even didn't work.
Lastly we created a new folder and updated the path with the new folder. It worked properly.
But I want to know what could be the cause of this issue. This may happen with other folder on Production.
Any help is appreciated. Thanks in advance
Following is stack trace:
type="System.IO.IOException"
message="An attempt was made to create more links on a file than the file system supports."
source="mscorlib"
detail="System.Exception
System.IO.IOException: An attempt was made to create more links on a file than the file system supports.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at ICSharpCode.SharpZipLib.Zip.FastZip.ExtractEntry(ZipEntry entry)
at ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip(Stream inputStream, String targetDirectory, Overwrite overwrite, ConfirmOverwriteDelegate confirmDelegate, String fileFilter, String directoryFilter, Boolean restoreDateTime, Boolean isStreamOwner)
at ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip(String zipFileName, String targetDirectory, Overwrite overwrite, ConfirmOverwriteDelegate confirmDelegate, String fileFilter, String directoryFilter, Boolean restoreDateTime)
at MyProject.ProjectFile.File.UnzipFile(String ErrorFile, String& ErrorXMLPath, String& FEXMLPath, String mXMLPath)
at MyProject.ProjectFile.File.ValidateUnzippedFile(Object items)
--- End of inner exception stack trace ---