Results 1 to 8 of 8

Thread: <?> Inside a zip file (making changes)

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    I am receiving a zip file from an outside vendor.
    The file name is similar to
    abc242.20001110.1252.zip
    I am shelling pkzip to unzip this file so before I can
    do that I must rename the file as pkunzip does not handle long names. Not a problem.
    However when I try to extract it, the file inside the zip file has the same name (abc242.20001110.1252.txt) with a txt extension.
    Problem: pkunzip can't handle the long name

    Is there some way to change this name (insdie the zip file) and have the file unzipped by PKUNZIP. Winzip is available but I haven't tried it as I don't want any user intervention...I would like this done behind the sceens as the user just starts the program, enters a date, and the app does the rest wihtout any further process by user.


    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  2. #2
    Guest
    there is a version of pkzip on their website that
    works with long filenames

    command line version 2.50

  3. #3
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    Maybe the file format specification of a zip file helps you.

    btw, when I tried to reply to this thread, this forum said
    'Invalid thread specified'. And when I went again to general vb questions, the thread was gone. Then I clicked refresh, and the thread was there and I could reply again.
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    there is a version of pkzip on their website that
    works with long filenames

    command line version 2.50
    Click here to download PkZip 2.50
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  5. #5

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Thanks
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    btw, here's how you can get the long filename out of the zip without listing them with pkzip:
    http://forums.vb-world.net/showthrea...threadid=37650
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Back to the drawing board. This newer version of pkunzip deals with long names but not on NT.

    kedaman, I tried your code but I can't make head nor tail out of it.

    [code]
    Function FilesInZip() As String()
    Dim temp As fileHeader, buffer() As Byte, n As Long, result() As String
    Open "C:\windows\desktop\zip_form.zip" For Binary As 1

    1> What am I passing to the function?()
    2> I assum C:\windows\desk is the file you want to get into
    3> I assum you get an 8 digit name in return.

    Help!
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    well, i was just experimenting with something i got from wotsit, btw a great site So i guess i can improove it a bit, send file as a string and it will open it.

    Code:
    Function FilesInZip(file as string ) As String()
      Open file For Binary As 1
    Nope i've tested, it returns full names, in a variable length string array.
    The thing is that i read a fixed length header, of which i get the name length (in a specific integer). Next i read the filename itself. Strconv just converts the byte array into string. next theres something i'm not too sure about, some version of zips have an extra descriptor which i have to jump over. The whole loop goes until the end of file and skips directory data by checking for the signature in the header.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

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



Click Here to Expand Forum to Full Width