Welcome to the Xceed Community | Help
Community Search  
More Search Options

Help with tar.gz file

Sort Posts: Previous Next
  •  06-14-2012, 11:56 AM Post no. 32251

    Help with tar.gz file

    Newbie here trying to extract tar.gz file in VB.NET 4.0.  My source file is  "C:\...\pickup\4NCrecords.SC_1337738401.tar.gz" and the target file inside is   "C:\...\pickup\4NCrecords.SC_1337738401.csv".  The numbered part of the filename will change daily.

    So far I have this from Xceed help files:

    Public Shared Sub UnTar()
      Dim diskFile As New DiskFile("C:\My_Documents\NCID\DDS\SouthCarolina\data\pickup\4NCrecords.SC_1337738401.tar.gz")
      Dim gzip As New GZippedFile(diskFile)
      Dim tar As New TarArchive(gzip)
      Dim file As AbstractFile
      file = tar.GetFile("C:\My_Documents\NCID\DDS\SouthCarolina\data\pickup\4NCrecords.SC_1337738401.csv")

      If file.Exists Then
        file.Delete()
      End If

    End Sub

    Thanks much for any help!

  •  06-14-2012, 8:48 PM Post no. 32253 in reply to 32251

    Re: Help with tar.gz file

    Hi Bil,

    I'm not clear as to what your requirements are as there is no question. If you require any help with simple commands on tarring and untarring, you can always refer to the Xceed FileSystem Snippet Explorer. In the application, you will find various topics concerning the Xceed components that use the FileSystem architecture that we provide. You can find the application installed on your machine. If you have installed the component and left the directories to the default ones, then you should be able to find it here:

    C:\Program Files (x86)\Xceed\Xceed Zip for .NET v5.1\Bin\Xceed.FileSystem.SnippetExplorer.exe

    In the executable, you can quickly go to topic #5 for the use of the Tar classes. You can find an example for basic scenarios when dealing with tar files. Remember, you are not limited to the functionality shown in the snippet explorer. You can find more information in the online documentation. If you have any more questions, please feel free to ask!

     


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
  •  06-15-2012, 11:23 AM Post no. 32259 in reply to 32253

    Re: Help with tar.gz file

    Thank you Marc. Sorry for the confusing post. I misinterpreted the code I quoted from Xceed Help and now realize it means 'delete' the file, not 'extract'.  So yes, 5.7.2 (Extract from tar.gz archives) is right on point.

    Currently I am struggling to understand the Xceed folder/file system, so I can point the code to a specific file/folder rather than the Temporary folder.

     And the file name will change daily, i.e.: 4NCrecords.SC_1337727231.tar.gz, 4NCrecords.SC_133778479.tar.gz, etc.

    Thanks again.

  •  06-16-2012, 11:51 AM Post no. 32261 in reply to 32259

    Re: Help with tar.gz file

    Hi Bil,

    You can also refer to this document from our online documentation here. In the example, you are explicitly stating where the file resides on. It is a much simpler example with more explanation as to what is being done and what is required. Is there a pattern as to how the file names are constructed? Knowing the file name is essential to the component so that it understands which file to extract.

    I hope this makes it clearer for you!


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.