BlitzmaxNG hanging on zipstream

Started by Ashmoor, July 18, 2020, 22:38:09

Previous topic - Next topic

Derron

Code (Blitzmax) Select

SuperStrict

Framework Brl.StandardIO
Import Brl.Audio 'TSound
Import Brl.OggLoader 'to decode OGG
Import Brl.IO
Import Brl.RamStream
Import Brl.FileSystem

Incbin "music.zip"


MaxIO.Init()
print "MountIncBin result: " + MaxIO.Mount("incbin::music.zip", "music")
'skip the "incbin::" then
'print "MountIncBin result: " + MaxIO.MountIncbin("music.zip", "music")

'what files are now in "music" ?
local files:string[] = loaddir(currentdir()+"/music")
for local t:String=eachin files
print t
next


Local incbinZipOggStream:TStream = ReadStream("music/example.ogg")
If incbinZipOggStream Then Print "loaded ogg stream from incbinned zip file"
If Not incbinZipOggStream Then Print "failed loading ogg stream from incbinned zip file"

Local incbinZipOggSound:TSound = LoadSound(incbinZipOggStream)
If incbinZipOggSound Then Print "loaded sound by stream from incbinned zip file"
If Not incbinZipOggSound Then Print "failed loading sound by stream from incbinned zip file"

Local incbinZipTune:TSound = LoadSound("music/example.ogg")
If incbinZipTune Then Print "loaded sound from incbinned zip file"
If Not incbinZipTune Then Print "failed loading sound from incbinned zip file"

Print "DONE.


Give this a try.


bye
Ron

Ashmoor

@Derron,

Your code seems to run fine on windows. Thanks. Is there any way to use a password protected zip file?


Derron

Brl.io uses pub.physfs.

according to physfs:

Quote
- ZIP files may be password-protected. As the PkWare specs specify, each
file in the .zip may have a different password, so you call
PHYSFS_openRead(a, "file_that_i_want.txt$PASSWORD") to make it work.
Note that this is a wildly insecure way to protect your app's data, both
in how you'd have to manage passwords and that "traditional" PkWare
crypto is not really hardened anyhow. But if you have a basic
password-protected archive, PhysicsFS can get into it now!


maybe try it that way (appending "$yourpassword" to filenames which are inside the mounted zip or 7z ...)?


bye
Ron

Ashmoor


Henri

Seems fairly simple.

Midimaster, did you have time to test Ron's code if that solves your issues ?

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Midimaster

haven't tested it yet.

As I have to update the first three of 16 projects to BigSur as fast as possible (users are already waiting), I now use my workaround the next days, until the trouble on the hotline calmes down.

But them I would like to test it and add it to all my project. All 16 projects are using Koriolis Zipstream, so I need this professional solution.

And I will have some additional questions related to migration from BlitzMax 1.51 to BlitzMax NG. f.e. Building PDFs with Cairo does not work any more. At the moment I publish reduced versions without PDF features.

At the moment a lot of thanks to all the people supporting me. Also via E-Mails. This is a awesome community.

...back from Egypt

Henri

Fair enough.

Can you create a separate thread for the Cairo issue and I can take a look ?

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Midimaster

#22
of course i will start another thread... but relax... not this week...

At the moment I collect experiences with new MACs. Users reporting the behavior and I change the downloads continuously.

If you want to participate the test phase: here is a free version of Score-Trainer (app to learn notes):
http://www.midimaster.de/downloads/ScoreTrainerXXL.app.zip

known issues:
Menu-Help: The manual is not working -> App hangs DONE



of course there is also a version for Windows:
http://www.midimaster.de/downloads/InstallScoreTrainer.exe



...back from Egypt