DOESFILEXIST dont work in shoeboxes

Previous topic - Next topic

ampos

I have this on my prog:

Code (glbasic) Select
/media/
   /levels
     001.lvl
      ...


DOESFILEEXIST always returns 0 if a shoebox (media.sbx) is used instead the /media dir for checking of the existence of "/levels/001.lvl"

If you can not reproduce it or do not find the error, I can write a program and sent the prog and files.

MrTAToad

Are you trying to use DOESFILEEXIST with a file in a shoebox file ?  If so, then it wont work as DOESFILEEXIST doesn't examine the contents of shoebox files

Slydog

#2
Instead of 'DOESFILEEXIST()', you could code your own function, but since shoeboxes can hold multiple types of files you may have to create multiple checks like 'DOESFILEEXIST_SPRITE%: file_name$', and 'DOESFILE_EXIST_SOUND . . etc.

Or, just wrap your file opening code with the TRY ... CATCH ... FINALLY error checking functionality.
If 'CATCH' is triggered, the file doesn't exist (probably).

But updating 'DOESFILEEXIST()' by Gernot would make it much simpler!  Or add a 'SHOEBOXSEARCH()' command or something.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

ampos

MrToad, let me explai.

I have 25 levels, than can be more or less, depending if I have done more or less.

Before trying to load a new level, I check if it does exist. If not, try the next one (or really, should be the first...)

My call to DOESFILEEXIST is not trying to find if the shoebox file exist, but if the files INSIDE the shoebox exist. As it should be, as setshoebox, in someway, redirects the file commands to the shoebox.

As a sidenote, in "setsoebox all.sbx,snd.sbx", the shoebox for audio only load music, samples (loadsound) are read from the other showbox file.

Also, if there is a dir called "media", the shoebox file is ignored, even if this /media dir is empty.

MrTAToad

DOESFILEEXIST doesn't work with files inside shoebox files.  It only works with files outside.

ampos


MrTAToad


matchy

It doesn't so that others don't go searching for files inside. That is the point of the shoebox.

Kitty Hello