0

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:

  1. 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

  2. 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.

  3. We tried alternate code to unzip file. That also didn't work.

  4. We checked for path whether its too long. But that is also not the case.Path was in limit.

  5. 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 ---

HeyItsMe007
  • 101
  • 2
  • 8
  • Does it work on local storage instead of the SAN? If so, can you adjust the SAN to allow more links on a file? Could there be other processes with handles to the files you were unzipping? – Andrew Morton Jun 12 '16 at 14:30
  • On local storage we tried and its working perfectly fine. I didn't get the 2nd question. How to adjust SAN to create more links ? Answer for 3rd question : No other process uses the same folder. – HeyItsMe007 Jun 12 '16 at 14:37
  • The error refers to *a file*. The computer running SharpZipLib has asked the SAN for a handle to the file, and the SAN has replied that it cannot create *another* handle to that file. You may need to consult the SAN documentation. You could write a program which tries to take as many separate handles to one file as possible, and see what the limit is. – Andrew Morton Jun 12 '16 at 14:45
  • I am not getting what you are saying......... what is the meaning to write a program which tried to take as many separate handles? and how to write it? – HeyItsMe007 Jun 12 '16 at 18:24
  • The idea was to investigate how many links to a file are possible on the SAN, to try and isolate the problem. It might be a good idea to talk to the SAN administrator about the problem. – Andrew Morton Jun 13 '16 at 07:39
  • Here issue is we don't have any SAN administrator here. – HeyItsMe007 Jun 13 '16 at 09:13
  • In that case, copy the zip file to a local drive, unzip it, and copy the files back to the SAN. It will work, and it will not create any extra network traffic. – Andrew Morton Jun 15 '16 at 20:31

0 Answers0