Author Topic: GETFILE does not work with shoebox  (Read 5470 times)

Offline adaz

  • Mc. Print
  • *
  • Posts: 48
    • View Profile
GETFILE does not work with shoebox
« on: 2014-Jun-17 »
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
« Last Edit: 2014-Jun-17 by adaz »

MrTAToad

  • Guest
Re: GETFILE does not work with shoebox
« Reply #1 on: 2014-Jun-17 »
Thats right - most of the file commands dont.

Offline adaz

  • Mc. Print
  • *
  • Posts: 48
    • View Profile
Re: GETFILE does not work with shoebox
« Reply #2 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

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1137
    • View Profile
    • My GLBasic code archiv
Re: GETFILE does not work with shoebox
« Reply #3 on: 2014-Jun-17 »
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

Offline adaz

  • Mc. Print
  • *
  • Posts: 48
    • View Profile
Re: GETFILE does not work with shoebox
« Reply #4 on: 2014-Jun-17 »
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

  • Guest
Re: GETFILE does not work with shoebox
« Reply #5 on: 2014-Jun-17 »
It was mentioned ages ago, but there are no plans to allow I/O commands to access shoeboxed data.

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1137
    • View Profile
    • My GLBasic code archiv
Re: GETFILE does not work with shoebox
« Reply #6 on: 2014-Jun-18 »
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

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1545
    • View Profile
Re: GETFILE does not work with shoebox
« Reply #7 on: 2014-Jun-18 »
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.


Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3955
    • View Profile
    • Space Fractal
Re: GETFILE does not work with shoebox
« Reply #8 on: 2014-Jun-18 »
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 and The beagle Jam.

Offline kanonet

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1137
    • View Profile
    • My GLBasic code archiv
Re: GETFILE does not work with shoebox
« Reply #9 on: 2014-Jun-19 »
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

Offline adaz

  • Mc. Print
  • *
  • Posts: 48
    • View Profile
Re: GETFILE does not work with shoebox
« Reply #10 on: 2014-Jun-24 »
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!"?
« Last Edit: 2014-Jun-24 by adaz »

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4159
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: GETFILE does not work with shoebox
« Reply #11 on: 2014-Jun-24 »
Yep. Confirmed.
I came. I saw. I played.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5111
  • O Rly?
    • View Profile
Re: GETFILE does not work with shoebox
« Reply #12 on: 2014-Jun-24 »
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 1700 @3.9GHz, 16GB HyperX Fury 3000MHz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline adaz

  • Mc. Print
  • *
  • Posts: 48
    • View Profile
Re: GETFILE does not work with shoebox
« Reply #13 on: 2014-Jun-25 »
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

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3955
    • View Profile
    • Space Fractal
Re: GETFILE does not work with shoebox
« Reply #14 on: 2014-Jun-25 »
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 and The beagle Jam.