[delphizip] Re: Long filename not extracting properly

  • From: Randall Sell <randallsell@xxxxxxxxx>
  • To: delphizip@xxxxxxxxxxxxx
  • Date: Mon, 5 Feb 2007 17:07:16 -0800 (PST)

short of giving you the whole app, it seems hard to reproduce solo. I already 
tried that - and it worked then. I will email the zip to problems@xxxxxxxxxxxxx 
so at least you have the zip in question to analyze if has proper structure, 
etc. And will test the new rev sometime shortly. Please send me a mail when it 
is out there. I have no idea when your evening is. :)
-rs

"R.Peters" <russellpeters@xxxxxxxxxxx> wrote: I have been checking the code 
(again and again - each time I am less happy
with it).
Under WinXP (and Win2K) the only way it should happen is if Windows rejects
the path component (filename) as invalid.
One of the reasons I am unhappy with the code is that if the path was too
long it could not get to this section to be 'shortened' (should be converted
to a short filename) so it just gets truncated.

If you can give some clues as to how you duplicated the problem it may help
or perhaps you can make a log file to send to me at problems@xxxxxxxxxxxxxx
To make a log file write a text file 'DelZip179.ini'
[ZIP]
Level = 0
[UNZIP]
Level = 2
// you may want to add
Path="d:\"

To put the log file in a convenient place.

I hope to have a possible interim fix (replaced old type OpenFile with newer
CreateFile) and better diagnostics available by later this evening (my time)
after I have had time to run some tests.

When ready the new dll will be at
http://www.delphizip.org/files/dz070205.zip
At least until we find whether it fixed the problem or not.

- Russell Peters
-----Original Message-----
From: delphizip-bounce@xxxxxxxxxxxxx [mailto:delphizip-bounce@xxxxxxxxxxxxx]
On Behalf Of Randall Sell
Sent: Monday, February 05, 2007 4:30 PM
To: delphizip@xxxxxxxxxxxxx
Subject: [delphizip] Re: Long filename not extracting properly
Importance: High

I have reproduced the problem under Win2K - all the service packs (what we
at, 2?) I'm using Delphi 7.02, and ZipMaster 1.79 (now uses Delzip179.dll).
I should have tested under XP but most likely it happens there as well since
it was a client that brought it to my attention, and they almost exclusively
run XP. 
Sadly, I have no control over the filenames. So as a test, I could dummy up
the example you give, but I already know that this file will extract under
some conditions. When that is exactly I can't pinpoint - hence the reason
I'm going to the ZipMasters :)

rs


James Turner  wrote: Assuming the Unzip DLL
allocates buffers large enough for long file names, the most likely cause of
the problem is an operating system issue. My guess woud be the API function
CreateFile is failing (assuming CreateFile is used - it should be). If the
Unzip DLL has sufficient diagnostics, this should be verified - the value of
GetLastError will also be needed.

I repeat, I have seen Windows have problems with very long file names such
as "Tender Document 4.0 Terms and Conditions of Contract_IRB0001.doc". 
Generally, they should be avoided in favour of directories. To verify this
try breaking it down to "Tender Document 4.0\Terms and Conditions of
Contract\IRB0001.doc". My guess is that by replacing a couple of characters
with slashes (forward or backward) file extraction will work correctly.

What Version of Windows and what filing system are you using?

-- James Turner


----- Original Message -----
From: "Randall Sell" 
To: 
Sent: Sunday, February 04, 2007 12:59 PM
Subject: [delphizip] Re: Long filename not extracting properly


> Well, after a lot more testing, it would appear that it may be related to 
> how the zip is created? Either that, or the order in which they are 
> extracted. The reason I suspect this is because I went and modified the 
> zip contents and changed it to a nice small filename: "x.zip" - and that 
> worked (phew). Then I went in, and added the big filename again - and it 
> worked as well. So now two files attached, "x,doc" and the big filename. 
> So maybe problem relates to the order in which things are extracted? And 
> if the first one (or the last one) happens to be a long name... hard to 
> say not being the code author.
> anyway, that's what I know... Let's hope the client doesn't find it :)
>
> -rs
>
>
> Randall Sell  wrote: This is a very odd problem...
> If I run via delphi debugger specifying my command line (which is then 
> extracted) it will work correctly.
>
> If I launch via Windows Explorer (file association is setup) then it 
> truncates this entry. but it is ONLY this one entry. All the other long 
> filenames are correct.
>
> If I don't use any sort of file associations, or command line params, and 
> just open the file via the EXE's file | Open - it fails there as well. 
> I'd be pretty happy to chalk it up to a bug in ZipMaster - but the bloody 
> thing works in some cases, and it works fine when I use the Demo1 app. so 
> I'm stumped.
>
> The full path to the file, when extracted is 136 chars:
> D:\Documents and Settings\rj\Local 
> Settings\Temp\irb6AF.DHT\Attachments\Tender Document 4.0 Terms and 
> Conditions of Contract_IRB0001.doc
>
> -randall
>

-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.


 
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.

-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.

-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.


 
---------------------------------
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.

-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.

Other related posts: