GETFILE does not work with shoebox

Previous topic - Next topic

adaz

test.sbx contains a file: test.txt
test.txt contains 20 lines of text

Code (glbasic) Select

SETSHOEBOX "test.sbx",""

GETFILE "test.txt", 0, a$
PRINT a$,0,200
//correctly displays line 0 of test.txt

GETFILE "test.txt", 1, a$
PRINT a$,0,250
//displays: "NO_DATA"


The above code works when I don't use shoebox.
V12.096

MrTAToad

Thats right - most of the file commands dont.

adaz

Quote from: MrTAToad on 2014-Jun-17
Thats right - most of the file commands dont.

And now? This is the "solution"? It would have been the last step to finish my iPhone game, and create my level packs. Great.
I can only hope that Gernot knows about this bug, and he will fix it soon. I don't know of any other solution to pack different kind of files into one.

Thanks

kanonet

I dont think its a bug, at least it have been always known that shoebox can only be used together with media files etc. - on the other had the helpfile clearly states GETFILE is one of the few commands that do work with shoebox (you line 0 works as you said). So bug or error in the help file?

If you want hide your data from the user, you could instead use ENCRYPT and DECRYPT to be a but saver.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

adaz

Thanks, I already use encrypt, but I wanted to protect my level map data with the necessary image files in one big file. So this is impossible because of some bugs.

If there was some kind of multiplatform (un)zip/rar etc. packer (with password support) we could use in GLB, that'd be marvelous!

Adaz

MrTAToad

It was mentioned ages ago, but there are no plans to allow I/O commands to access shoeboxed data.

kanonet

Since SHOEBOX works with sprites etc. and just not with your text file, you could simply pack all sprites etc. into the shoebox and only leave your text file outside and store it encrypted instead. Or even cooler, you convert your data in a way so that you can store it in an integer array - then you can save this array with MEM2SPRITE as PNG and load it with LOADMEMSPRITE from the shoebox.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

matchy

Quote from: adaz on 2014-Jun-17
If there was some kind of multiplatform (un)zip/rar etc. packer (with password support) we could use in GLB, that'd be marvelous!

The SHELL command can issue a bat/bash script, such as a zip command line or any other alternative encrypt-er/packager/application.


spacefractal

http://www.glbasic.com/forum/index.php?topic=7639.0 can do the trick, by convert the tile data format to a png file? Im have not tested this one, but its one of the clever way to store data into a png file.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

kanonet

Yes Spacefractal that is what I was meaning, Wampus just had an awesome idea,that we can use to store any data in a SHOEBOX.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

adaz

#10
I just tried to store a simple JPG in shoebox, but it cannot be read back! Error:3 (not found)
PNG and BMP work, but I cannot read jpg's from it...
Very annoying, now I have to rethink my idea and rewrite my whole file handling/compressing algorithm because of an old, unhandled bug:(( http://www.glbasic.com/forum/index.php?topic=6858.msg55507#msg55507
Moreover, if this is an old bug (or known deficiency), why the shoebox creator doesn't display an error message like "JPG's currently not supported!"?

Ian Price

I came. I saw. I played.

Schranz0r

Write youre own method to pack all files and leveldata in one file then crypt it...
Its easy!
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

adaz

Quote from: Schranz0r on 2014-Jun-24
Write youre own method to pack all files and leveldata in one file then crypt it...
Its easy!
I's not so easy for me... I has to work on iPhone as well.
Do you have an idea or plan for implementation?
Thanks

spacefractal

Also a shoebox file is not secure too, they are easy to extract all files on it.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/