ABZipUnzip ABZipDirectory Function

rtesluk

Member
Licensed User
Longtime User
Sep 4 2011
15:50 Hours

When I zip a folder with files in the folder, the 'list' function reveals in a ListView that the FIRST character of each file is truncated.

I placed the the ABZipUnzip in a code module named CodeModule

Dim ZipUnzip As ABZipUnzip
Dim ZipContent As ABZipContent
Here is the code to produce the zip file with a folder

ShortName = LabelSrcDir.Text.SubString2(s + 1, e)
CodeModule.ZipUnzip.ABZipDirectory(LabelSrcDir.Text,LabelDstDir.Text & ShortName & ".zip")

e.g.

Instead of House Sparrow.WAV, I get ouse Sparrow.WAV

Interesting problem.

Ray Tesluk :sign0085:
 

rtesluk

Member
Licensed User
Longtime User
ShortName calculation from the path

e.g. path
' LabelSrcDir.Text = "/mnt/sdcard/TCAsamples/Flycatchers/"
ShortName = LabelSrcDir.Text
' Shortname = "/mnt/sdcard/TCAsamples/Flycatchers/"

' Finding the LAST two /'s

e = 0 : s = 0
For i = Shortname.Length - 1 To 0 Step -1
If Shortname.CharAt(i) = "/" Then
If e = 0 Then
e = i
Else
If s = 0 Then
s = i
End If
End If
End If
Next

' s (start) has the value for the position of SECOND LAST /
' e (end) has the value for the position of the FIRST LAST /
' s is "/"
' s + 1 is "F"
' e is "/"

ShortName = LabelSrcDir.Text.SubString2(s + 1, e)
' ShortName = "Flycatchers"
CodeModule.ZipUnzip.ABZipDirectory(LabelSrcDir.Text,LabelDstDir.Text & ShortName & ".zip")

I hope these comments make it clearer

Ray :sign0013:
 
Upvote 0

rtesluk

Member
Licensed User
Longtime User
SnapShot when I list the zip

Sep 4 2011
23:58 Hours

I have uploaded snapshot using Paint Pro of the problem of the missing FIRST character of a zip file created with library ABZipUnzip

Ray Tesluk
 

Attachments

  • Flycatcher.jpg
    Flycatcher.jpg
    13.6 KB · Views: 369
Upvote 0

rtesluk

Member
Licensed User
Longtime User
I hope this image is bigger and better to demonstrate the problem of the missing FIRST character.

In the first file in the zip file it reads

ellow-bellied Flycatcher3.jpg

it should be

Yellow-bellied Flycatcher3.jpg

The 'Y' is missing.

Ray Tesluk
 

Attachments

  • Flycatcher1.jpg
    Flycatcher1.jpg
    21.8 KB · Views: 322
Upvote 0

rtesluk

Member
Licensed User
Longtime User
Thanks for checking out the code

Sep 5 2011
03:30 Hours

Thank you Klauz for checking out the code.

This project has been a work in progress to understand the functions of the ABZipUnzip library.

There are few old subs and views that are not used anymore - therefore the project is somewhat cluttered.

I think I will create a NEW project and import the essential views and codes from the old project.

The compiler is processing unnecessary lines of code.

Perhaps by stream-lining the project, the problem might go away.

I am bit concerned about the names of files that I am using. They have SPACES in their names but we will see if that's a problem.

I'll let you know in a few days when I have completed the new project.

Thanks again for your help in this matter.

Ray Tesluk
 
Upvote 0

rtesluk

Member
Licensed User
Longtime User
Uncluttered Project - still the problem

Sep 5 2011
15:10 Hours

Hi

The problem persists even after rebuilding a new project and getting rid of the unsued sub, views and code.

The files in the zipped folder have their FIRST character truncated.

Would anyone like to check out this project from an exported zip file that I could upload?

Ray T.
 
Upvote 0

rtesluk

Member
Licensed User
Longtime User
ABZipUnzip Unzip Folder Problem

Sep 6 2011
03:30 Hours

Thank you Klauz.

I have just uploaded the project.

Ray T
 

Attachments

  • TUtil20110905.zip
    41.7 KB · Views: 346
Upvote 0

rtesluk

Member
Licensed User
Longtime User
ABZipUnzip Unzip Folder Problem

Sep 6 2011
04:45 Hours

I have removed more clutter - views, subs, etc from the project to make it more manageable.

Ray T. :icon_clap:
 

Attachments

  • TUtil20110906.zip
    41.1 KB · Views: 343
Upvote 0

klaus

Expert
Licensed User
Longtime User
I'm afraid that the problem is in the library in the ABZipDirectory function.
The code snippet you posted in your first post work OK in your project.
I looked in the zip file generated by the library and the first characters of the files are missing.

Best regards.
 
Upvote 0

rtesluk

Member
Licensed User
Longtime User
ABZipUnzip ABZipDirectory Function

Sep 6 2011
06:40 Hours

Thank you Klauz for verifying the bug in that function.

I guess someone should notify Alain Bailleul about this problem.

I do not know how to contact him thru the forum.

I will just have to await an update on this library.

Many thanks,

Ray Tesluk M.D. :icon_clap:
 
Upvote 0
Top