Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Problems creating a spanned archive on removable storage with SplitNameFormat set to something other than None

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20237 |

    Hi

    I am experiencing a few issues with the Zip component for .net (i am using the latest version available on the website).

    Im trying to write out spanned zip archives to removable storage drives – a single zip operation is expected to use multiple disks/pens/etc (hence the requirement for spanning).

    When i set the SplitNameFormat member variable of a ZipArchive instance to a value other than None, and attempt to write a spanned zip to a removable storage device and the available space on the medium becomes exhausted, the DiskRequired event handler does not seem to get called and the process of writing the zip file fails with an exception.

    Message    “Cannot copy a file onto itself. Type: Xceed.FileSystem.DiskFile FullName: J:\Test\folder_2001.zip”    StringSource    “Xceed.Zip”  

    StringStackTrace    ”   at Xceed.Zip.ZipArchive.EndUpdate(FileSystemEvents events, Object userData)

    at HUA.BackMenuNET.fBackup.ZipFiles(String zipFilename, String[] sourceFilenames) in C:\dev\BackMenuNET\fBackup.vb:line 876

    at HUA.BackMenuNET.fBackup.BackupFolder(String zipFilename, String fileExclusionMask, String folderExclusionMask, String source) in C:\dev\BackMenuNET\fBackup.vb:line 931″    String

    However, when SplitNameFormat is set to None different behaviour is exhibited (the DiskRequired event handler is called) – a spanned zip file is created (multiple parts of the same file name), but unfortunately this zip file occasionally seems to be corrupt and not readable by other zip file tools.

    From the contents of the exception, it seems to me it is originating from within the xceed zip component.

    the events being handled are:

    BuildingZipByteProgression – updates gui

    ByteProgression – updates gui

    DiskRequired – pauses thread with dialog, prompting user to insert new disk

    ItemException – records exceptions to log system

    Has anyone else come across this? Is this a known issue? How might i resolve this?

    p.s. here is the full generated exception:

     


    -        ex                            {Xceed.FileSystem.FileSystemNotSupportedException}                            System.Exception
    -        Xceed.FileSystem.FileSystemNotSupportedException    {"Cannot copy a file onto itself. Type: Xceed.FileSystem.DiskFile FullName: J:\Test\folder_2001.zip"}    Xceed.FileSystem.FileSystemNotSupportedException
    +        Data                            {System.Collections.ListDictionaryInternal}                                System.Collections.IDictionary
            HelpLink                        Nothing                                                    String
            InnerException                        Nothing                                                    System.Exception
    -        Item                            {Xceed.FileSystem.DiskFile}                                        Xceed.FileSystem.FileSystemItem
    +        Xceed.FileSystem.DiskFile                {Xceed.FileSystem.DiskFile}                                        Xceed.FileSystem.DiskFile
            AltFolderSeparator                    "/"                                                    String
            Attributes                        Normal {128}                                                System.IO.FileAttributes
            CreationDateTime                    #9/21/2009 10:42:18 AM#                                            Date
            Exists                            True                                                    Boolean
            FolderSeparator                        "\"                                                    String
            FullName                        "J:\Test\folder_2001.zip"                                        String
            HasAttributes                        True                                                    Boolean
            HasCreationDateTime                    True                                                    Boolean
            HasLastAccessDateTime                    True                                                    Boolean
            HasLastWriteDateTime                    True                                                    Boolean
            HostedFullName                        "J:\Test\folder_2001.zip"                                        String
            HostFile                        Nothing                                                    Xceed.FileSystem.AbstractFile
            LastAccessDateTime                    #9/21/2009#                                                Date
            LastWriteDateTime                    #9/21/2009 10:45:48 AM#                                            Date
            Name                            "folder_2001.zip"                                            String
    +        ParentFolder                        {Xceed.FileSystem.DiskFolder}                                        Xceed.FileSystem.AbstractFolder
    +        RootFolder                        {Xceed.FileSystem.DiskFolder}                                        Xceed.FileSystem.AbstractFolder
            Message                            "Cannot copy a file onto itself. Type: Xceed.FileSystem.DiskFile FullName: J:\Test\folder_2001.zip"    String
            Source                            "Xceed.Zip"                                                String

            StackTrace    "   at Xceed.Zip.ZipArchive.EndUpdate(FileSystemEvents events, Object userData)
               at HUA.BackMenuNET.fBackup.ZipFiles(String zipFilename, String[] sourceFilenames) in C:\dev\BackMenuNET\fBackup.vb:line 876
               at HUA.BackMenuNET.fBackup.BackupFolder(String zipFilename, String fileExclusionMask, String folderExclusionMask, String source) in C:\dev\BackMenuNET\fBackup.vb:line 931"    String

    +        TargetSite                        {System.Reflection.RuntimeMethodInfo}                                    System.Reflection.MethodBase
    +        Data                            {System.Collections.ListDictionaryInternal}                                System.Collections.IDictionary
            HelpLink                        Nothing                                                    String
            InnerException                        Nothing                                                    System.Exception
            Message                            "Cannot copy a file onto itself. Type: Xceed.FileSystem.DiskFile FullName: J:\Test\folder_2001.zip"    String
            Source                            "Xceed.Zip"                                                String

            StackTrace    "   at Xceed.Zip.ZipArchive.EndUpdate(FileSystemEvents events, Object userData)
               at HUA.BackMenuNET.fBackup.ZipFiles(String zipFilename, String[] sourceFilenames) in C:\dev\BackMenuNET\fBackup.vb:line 876
               at HUA.BackMenuNET.fBackup.BackupFolder(String zipFilename, String fileExclusionMask, String folderExclusionMask, String source) in C:\dev\BackMenuNET\fBackup.vb:line 931"    String

    +        TargetSite                        {System.Reflection.RuntimeMethodInfo}                                    System.Reflection.MethodBase


     

     

    kind regards

    David Pickering

     

    Imported from legacy forums. Posted by David (had 2050 views)

    User (Old forums)
    Member
    Post count: 23064

    Just to add/clarify, when SplitNameFormat is set to None, and AllowSpanning is enabled – and i attempt to write a zip to a drive/medium/device whose size is smaller than the final zip file size (tested with: pen drive, local hard-drive with quota enabled, sdcard, etc), i intermittently experience the following exception:

    –        ex                    {Xceed.FileSystem.FileSystemException}    System.Exception
    –        Xceed.FileSystem.FileSystemException    {“The physical file represented by the item could not be created. Type: Xceed.FileSystem.DiskFile FullName: D:\New Folder\Junk Test Data_2001.zip”}    Xceed.FileSystem.FileSystemException
    +        Data    {System.Collections.ListDictionaryInternal}    System.Collections.IDictionary
            HelpLink    Nothing    String
    –        InnerException    {“There is not enough space on the disk.”}    System.Exception
    +        System.IO.IOException    {“There is not enough space on the disk.”}    System.IO.IOException
    +        Data    {System.Collections.ListDictionaryInternal}    System.Collections.IDictionary
            HelpLink    Nothing    String
            InnerException    Nothing    System.Exception
            Message    “There is not enough space on the disk.”    String
            Source    “mscorlib”    String
            StackTrace    ”   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
               at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
               at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
               at System.IO.FileInfo.Create()
               at Xceed.FileSystem.DiskFile.DoCreate(FileSystemEventsSession session)”    String
    +        TargetSite    {System.Reflection.RuntimeMethodInfo}    System.Reflection.MethodBase
    +        Item    {Xceed.FileSystem.DiskFile}    Xceed.FileSystem.FileSystemItem
            Message    “The physical file represented by the item could not be created. Type: Xceed.FileSystem.DiskFile FullName: D:\New Folder\Junk Test Data_2001.zip”    String
            Source    “Xceed.Zip”    String
            StackTrace    ”   at Xceed.Zip.ZipArchive.EndUpdate(FileSystemEvents events, Object userData)
               at HUA.BackMenuNET.fBackup.ZipFiles(String zipFilename, String[] sourceFilenames) in C:\dev\BackMenuNET\fBackup.vb:line 876
               at HUA.BackMenuNET.fBackup.BackupFolder(String zipFilename, String fileExclusionMask, String folderExclusionMask, String source) in C:\dev\BackMenuNET\fBackup.vb:line 931″    String
    +        TargetSite    {System.Reflection.RuntimeMethodInfo}    System.Reflection.MethodBase
    +        Data    {System.Collections.ListDictionaryInternal}    System.Collections.IDictionary
            HelpLink    Nothing    String
    –        InnerException    {“There is not enough space on the disk.”}    System.Exception
    +        System.IO.IOException    {“There is not enough space on the disk.”}    System.IO.IOException
    +        Data    {System.Collections.ListDictionaryInternal}    System.Collections.IDictionary
            HelpLink    Nothing    String
            InnerException    Nothing    System.Exception
            Message    “There is not enough space on the disk.”    String
            Source    “mscorlib”    String
            StackTrace    ”   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
               at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
               at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
               at System.IO.FileInfo.Create()
               at Xceed.FileSystem.DiskFile.DoCreate(FileSystemEventsSession session)”    String
    +        TargetSite    {System.Reflection.RuntimeMethodInfo}    System.Reflection.MethodBase
            Message    “The physical file represented by the item could not be created. Type: Xceed.FileSystem.DiskFile FullName: D:\New Folder\Junk Test Data_2001.zip”    String
            Source    “Xceed.Zip”    String
            StackTrace    ”   at Xceed.Zip.ZipArchive.EndUpdate(FileSystemEvents events, Object userData)
               at HUA.BackMenuNET.fBackup.ZipFiles(String zipFilename, String[] sourceFilenames) in C:\dev\BackMenuNET\fBackup.vb:line 876
               at HUA.BackMenuNET.fBackup.BackupFolder(String zipFilename, String fileExclusionMask, String folderExclusionMask, String source) in C:\dev\BackMenuNET\fBackup.vb:line 931″    String
    +        TargetSite    {System.Reflection.RuntimeMethodInfo}    System.Reflection.MethodBase

    the DiskRequired event handler is never called. How should i handle this – surely the zip component should automatically be detecting when and how to split the zip file and write it to disk instead of throwing a generic error.

    Has anyone else come across these issues?

    kind regards

    Dave

    Imported from legacy forums. Posted by David (had 578 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    there could be many reasons behind this exception and it is hard to diagnose without the source code.  The exception message is telling us that we are trying to write a file to itself.  This will occur if you are zipping a drive/folder but you are writing the file on a subfolder of the source drive/folder because you would then have a circular reference. 

    Your best option, at this point, is to understand what is really happening under the hood.  Step-by-step program execution, for example.  Try different settings (drive, folder, etc.).  There must be a logical explanation behind this exception.

    Best regards

    Imported from legacy forums. Posted by Ghislain (had 1564 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.