Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Generated temporary filename was not unique – Please

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

    I try to create a new ZIP using function CreateFile but; I recive this message:

     Generated temporary filename was not unique.

    Type: Xceed.FileSystem.DiskFile

    FullName: C:\Documents and Settings\MARTHAXP\ASPNET\LOCALS~1\Temp\b0bca9ce-998b-422a-9c86-5288ef2934f8.tmp

     Please if everyone say something help me.

    Imported from legacy forums. Posted by MoisesG (had 3120 views)

    User (Old forums)
    Member
    Post count: 23064

    Can you provide a code snippet of what you are doing exactly?

    Imported from legacy forums. Posted by André (had 594 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi im also getting this error

     Generated temporary filename was not unique. Type: Xceed.FileSystem.DiskFile FullName: C:\Documents and Settings\dpickering\Local Settings\Temp\aa74e1bd-1304-46c1-afcc-f0f94259fa8f.tmp

    im using the following function to zip multiple files:

     
        Private Function ZipFiles(ByVal zipFilename As String, ByVal sourceFilenames As String()) As Integer

            Dim zipArchive As ZipArchive = Nothing
            Dim errorCount As Integer = 0

            Try
                ‘ allocate the destination file and create an archive from it
                Dim zipFile As DiskFile = New DiskFile(zipFilename)
                Dim zipFolder As ZippedFolder
                zipArchive = New ZipArchive(zipFile)

                ‘ configure zip archive
                zipArchive.BeginUpdate(zipArchiveEvents, Nothing)
                ‘ moderate compression level
                zipArchive.DefaultCompressionLevel = Xceed.Compression.CompressionLevel.Normal
                zipArchive.DefaultCompressionMethod = Xceed.Compression.CompressionMethod.Deflated
                ‘ no encryption (though imo there should be tbh)
                zipArchive.DefaultEncryptionPassword = String.Empty
                ‘ multi-part zip files are confirmed as not required
                zipArchive.AllowSpanning = False

                ‘ process each file individually
                Dim sourceFilename As String = String.Empty
                Dim processedFileCount As Integer = 0

                ‘ iterate through specified filenames
                For Each sourceFilename In sourceFilenames

                    Try
                        ‘ check file location (root special handling)
                        Dim sourceFile As DiskFile = New DiskFile(sourceFilename)
                        Dim rootName As String = System.IO.Path.GetPathRoot(sourceFilename)
                        Dim pathName As String = System.IO.Path.GetDirectoryName(sourceFilename)

                        ‘ strip off path root (i.e. ‘c:\’)
                        pathName = pathName.Substring(rootName.Length, pathName.Length – rootName.Length)

                        ‘ If pathName and rootName are the same, the destination is the root of the
                        ‘ zip file so use “\” instead of string.empty
                        If pathName = String.Empty Then
                            pathName = “\”
                        End If

                        ‘ copy source file to destination zip ‘folder’
                        zipFolder = CType(zipArchive.GetFolder(pathName), ZippedFolder)
                        sourceFile.CopyTo(zipArchiveEvents, Nothing, zipFolder, True)
                    Catch ex As Exception
                        errorCount = errorCount + 1
                        EmitBackupError(ex.Message, zipFilename)
                    Finally
                        ‘ update status bar
                        Dim percentageComplete As Integer = CInt((processedFileCount / sourceFilenames.Length) * 100)
                        CType(MdiParent, fMain).sbMain.Panels(“Progress”).Visible = True
                        CType(MdiParent, fMain).sbMain.Panels(“Progress”).ProgressBarInfo.Value = percentageComplete

                        ‘ no need to pump win32 message queue here as zipArchiveEvents_ByteProgression does it for us
                        ‘Application.DoEvents()

                        ‘ increment file counter (for status bar update)
                        processedFileCount = processedFileCount + 1
                    End Try
                Next

                ‘delete output if errors occur to eliminate user confusion
                If errorCount > 0 Then
                    If File.Exists(zipFilename) Then File.Delete(zipFilename)
                End If
            Catch ex As Exception
                EmitBackupError(ex.Message, zipFilename)
            Finally
                If Not zipArchive Is Nothing Then
                    zipArchive.EndUpdate(zipArchiveEvents, Nothing)
                End If

                CType(MdiParent, fMain).sbMain.Panels(“Progress”).Visible = False
            End Try

            Return errorCount

        End Function

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

    User (Old forums)
    Member
    Post count: 23064

    Are you using the latest version (3.7)?  We had a bug before version 3.6 which is now corrected :

    A check is now made to ensure that a temp file has a unique name before it is created. 

     

    Imported from legacy forums. Posted by André (had 1615 views)

    User (Old forums)
    Member
    Post count: 23064

    Hello, we have a similar error trying to create a zip file using Xceed Copy method … I have check our DLL version and It is 4.1.9460.14460 v (Xceed.Zip.dll / Xceed.FileSystem.dll)

    here is our stack error

    This is the exception stack trace registered on the system:

    Xceed.FileSystem.FileSystemInternalException: Generated temporary filename was not unique.

    Type: Xceed.FileSystem.DiskFile

    FullName: c:\Temp\2016464f-f384-431c-ab41-0d756e001f6e.tmp —> Xceed.FileSystem.FileSystemException: The physical file represented by the item could not be created.

    Type: Xceed.FileSystem.DiskFile

    FullName: c:\Temp\2016464f-f384-431c-ab41-0d756e001f6e.tmp —> System.IO.IOException: Data error (cyclic redundancy check).

    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)

    — End of inner exception stack trace —

    at Xceed.FileSystem.FileSystemItem.Create(FileSystemEvents events, Object userData)

    at Xceed.FileSystem.FileSystemItem.Create()

    at Xceed.FileSystem.AbstractFolder.CreateTempFile()

    — End of inner exception stack trace —

    at Xceed.FileSystem.FileSystemItem.CopyTo(FileSystemEvents events, Object userData, AbstractFolder destinationFolder, Boolean replaceExistingFiles)

    at Xceed.FileSystem.FileSystemItem.CopyTo(AbstractFolder destinationFolder, Boolean replaceExistingFiles)

    at XXX.TestCasesDevelopmentKit.Results.ResultsManager.BuildResultFile(String source, String target, String password)

    at XXX.TestCasesDevelopmentKit.Results.ResultsManager.SaveResults()

    at XXX.TestCasesDevelopmentKit.Results.ResultsManager.Close()

    Imported from legacy forums. Posted by Francisco (had 1681 views)

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