Readdir question

Blitz3D Forums/Blitz3D Beginners Area/Readdir question

Farflame(Posted 2009) [#1]
Been a while since I used Blitz. I'm trying to search through the folder where the program itself is installed for a text file, but readdir needs the target folder to be named. Is there a way to effectively say readdir(the folder the program was loaded from), if I don't know the name of that folder until run-time?


GIB3D(Posted 2009) [#2]
Readdir CurrentDir()

I've wondered the same thing myself ;)


Floyd(Posted 2009) [#3]
CurrentDir() is often the same as the programs location, but could be anything.

SystemProperty("appdir") should be the application's directory.


Blitzplotter(Posted 2009) [#4]
managed to do this in VB6 where you podge a button the first time after the application is installed to populate a .ini file (a .txt file) with the path of the executing directory, not sure I managed to get B3D doing it, not to say it can't be done.


jfk EO-11110(Posted 2009) [#5]
This may be more reliable:
Print "Program was run from " + SystemProperty ("appdir")
Esp. in certain cases like running a SCR from within the System folder.
It is even recommended to
changedir SystemProperty ("appdir")
before you try to open a file in your EXEs or SCRs folder.