xboxscene.org forums

Author Topic: Getzipfilecount Messed Up  (Read 1666 times)

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Getzipfilecount Messed Up
« on: May 31, 2004, 08:39:00 AM »

I remember koldfuzion posted something about zips but could recall what it was exactly.

Anyways, the GetZipFileCount  function returns an extra count number. Like if the file has 3 files it will say there are 3 files when it should say 2 seeing how it's starting at 0.  <
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Getzipfilecount Messed Up
« Reply #1 on: May 31, 2004, 09:06:00 AM »

?? Well, isn't that how it SHOULD work?

The function is intended to get the number of entries in the file... like many similar functions in other APIs, it doesn't attempt to match the upper bounds value (due to zero-based indexing), but rather gives you exactly what it describes.  <
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Getzipfilecount Messed Up
« Reply #2 on: May 31, 2004, 09:15:00 AM »

Excuse my ignorence then BJ.

So its normal proceedure to Sub the zipcount by 1 before doing anything.  <
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Getzipfilecount Messed Up
« Reply #3 on: May 31, 2004, 08:11:00 AM »

QUOTE (flattspott @ May 31 2004, 12:04 PM)
Excuse my ignorence then BJ.

So its normal proceedure to Sub the zipcount by 1 before doing anything.

Well, I know it's a pain, but yes, you'd have to sub the number.  sad.gif

...and no need to apologize for anything, flattspott! The File Manager stuff is looking great, and just let me know what you need to make things happen.
Logged

koldfuzion

  • Archived User
  • Hero Member
  • *
  • Posts: 1226
Getzipfilecount Messed Up
« Reply #4 on: May 31, 2004, 09:23:00 AM »

i posted that you could get the info. but it doesnt extract.  <
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Getzipfilecount Messed Up
« Reply #5 on: May 31, 2004, 09:32:00 AM »

Getting the info and extracting works for me.

My degugging/test:

CODE

Set CurrentPathAndFile $ActualPath$\Test.zip
Set CurrentPath Z:

:UNZIP
OpenZip CurrentZipFile %CurrentPathAndFile%
SetFunc ZipCount GetZipFileCount CurrentZipFile
Sub ZipCount 1
MsgBox "ZipCount is %ZipCount%" 0 300
For I = 0 To %ZipCount%
  GetZipInfo CurrentZipFile %I%
  Set FileName%I% %ZipEntryName%
  MsgBox "File %I% is %FileName{I}%" 0 300
Next
For I = 0 To %ZipCount%
  UnzipFile CurrentZipFile %I% %CurrentPath%\%FileName{I}%
Next
CloseZip CurrentZipFile
MsgBox "File UnZipped" 0 300
// Return


EDIT: Maybe it was fixed since then
  • Fixed broken UnRar and UnZip support.  


This post has been edited by flattspott: May 31 2004, 04:43 PM <
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Getzipfilecount Messed Up
« Reply #6 on: May 31, 2004, 09:38:00 AM »

QUOTE
and just let me know what you need to make things happen.


I just have have a small question about the GetZipFileCount. Is that just for zip files or can it be used on rar files too.  <
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Getzipfilecount Messed Up
« Reply #7 on: May 31, 2004, 09:42:00 AM »

QUOTE (flattspott @ May 31 2004, 12:27 PM)

I just have have a small question about the GetZipFileCount. Is that just for zip files or can it be used on rar files too.

Well, unfortunately, there's a "GetRarFileCount"

I might play around a bit and see if I can make them interchangeable.   <
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Getzipfilecount Messed Up
« Reply #8 on: May 31, 2004, 09:47:00 AM »

QUOTE
Well, unfortunately, there's a "GetRarFileCount"


Oh, I didn't see that in the ActionscriptReadme or the ChangeLog. I figured either rar's didn't have it or they just used the GetZipFileCount. All is good then if that's the case.  <
Logged

koldfuzion

  • Archived User
  • Hero Member
  • *
  • Posts: 1226
Getzipfilecount Messed Up
« Reply #9 on: May 31, 2004, 11:36:00 AM »

QUOTE
EDIT: Maybe it was fixed since then
  • Fixed broken UnRar and UnZip support.


how did i miss that? last i knew it was still broken. grrr  <
Logged