Problem with incbin

BlitzMax Forums/BlitzMax Programming/Problem with incbin

klepto2(Posted 2005) [#1]
I want to include several files with incbin but now I have a problem:

It seems that the 'filetype' function doesn't work with incbin. does someone have an idea why or how i can also see if the incbin file exist?

ie : Print filetype("incbin::test.txt")
this always returns 0


Floyd(Posted 2005) [#2]
incbin builds the file into the executable program.

If the program compiles successfully then the file exists.


klepto2(Posted 2005) [#3]
I wrote a control program that prints out every single line and that works, but my problem is that I want to write a kind of documentation tool.

There are several files which are needed for the docs, but there are as well some files which are *.bmx or *.bb for examples files. Now the app should decide whether there is
a *.bmx or a *.bb file. If they are not included in the exe everything works fine by using the filetype function but this
function does not work with incbin.
I know that the files are there, because I can read them but only if I know if they are existing. But I want to make the program like:

Pseudo:
If filetype(incbin::abcdef.txt) = 0 then
Print "not documented"
else
Print file
endif


klepto2(Posted 2005) [#4]
I have now written my own little function to get if an IncBin file exist or not : (maybe it will help)

Function inc_filetype:Byte(incfile$)
if not Readfile(incfile$) then
Return False
else
Return True
endif
Endfunction

I know it is not much but it works.