Jump to content


Photo

Getzipfilecount Messed Up


  • Please log in to reply
9 replies to this topic

#1 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 31 May 2004 - 02:28 PM

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.

#2 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 31 May 2004 - 02:55 PM

?? 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.

#3 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 31 May 2004 - 03:04 PM

Excuse my ignorence then BJ.

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

#4 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 31 May 2004 - 03:11 PM

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.

#5 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 31 May 2004 - 03:12 PM

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

#6 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 31 May 2004 - 03:21 PM

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.

Edited by flattspott, 31 May 2004 - 03:32 PM.


#7 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 31 May 2004 - 03:27 PM

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.

#8 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 31 May 2004 - 03:31 PM

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.

#9 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 31 May 2004 - 03:36 PM

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.

#10 koldfuzion

koldfuzion

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,480 posts

Posted 31 May 2004 - 05:25 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users