Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all, Here is my problem, Im having a zip file say ex.zip I want to know what are all the files present in ex.zip without extracting or unziping it ...
  1. #1
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile Get file information without unzip

    Hi all,
    Here is my problem,
    Im having a zip file say ex.zip
    I want to know what are all the files present in ex.zip without extracting or unziping it ...
    i guess i have to use header information from zip format.
    how to do this???
    and which one will be efficient java or c for this program???
    Thanks
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,344
    You can use unzip e.g.
    Code:
    $unzip -l somefile.zip

  3. #3
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    thx.how to do that in programming.is there any built in C or java functions available for this.
    i don't want to use system() function with unzip.
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  4. #4
    Linux User
    Join Date
    Aug 2006
    Posts
    458
    if you have Python,
    Code:
    import zipfile
    f = zipfile.ZipFile("test.zip")
    for name in f.namelist():
        print name

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...