Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET Reading file attributes in a Zip File

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

    Hi guys,

    Is there a way i can read file attibutes of compressed files with out unzipping? Stuff such as last modified , and size.

    thanks
    A

    Imported from legacy forums. Posted by alita (had 3672 views)

    User (Old forums)
    Member
    Post count: 23064

    Anytime you have a ZippedFile or ZippedFolder instance, you can check the Attributes property to get that file or folder’s attributes, without unzipping anything. For example, if you get all ZippedFile recursively from a ZipArchive, you can consult attributes easily:

    ZipArchive archive = new ZipArchive( new DiskFile( @”d:\foobar.zip” ) );

    foreach( AbstractFile file in archive.GetFiles( true ) )
    {
    Console.WriteLine( file.Attributes );
    }

    Imported from legacy forums. Posted by Martin (had 330 views)

    User (Old forums)
    Member
    Post count: 23064

    nice thanks for the reply.

    What would be the code be like in .net though I am using vb.net.

    It doesnt seem to work the same.

    thanks guys!
    Alita

    Imported from legacy forums. Posted by alita (had 276 views)

    User (Old forums)
    Member
    Post count: 23064

    In VB.NET, it would be something like this:

    Dim archive As New ZipArchive( New DiskFile( “d:\foobar.zip” ) )

    For Each file As AbstractFile In archive.GetFiles( True )
    Console.WriteLine( file.Attributes )
    Next

    Imported from legacy forums. Posted by Martin (had 409 views)

    User (Old forums)
    Member
    Post count: 23064

    appriciated thank you

    Imported from legacy forums. Posted by alita (had 4701 views)

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