1. Find Resource
- Posted by xecronix 2 weeks ago
- 101 views
In case it's helpful to someone:
-- Returns a path to a file if it's found -- anywhere in the include_paths() global function find_resource(sequence fname) sequence paths = include_paths() for i=length(paths) to 1 by -1 do string candidate = paths[i] & fname if file_exists(candidate) then return candidate end if end for return "" -- not found end function
Example: (without error checking)
sequence dll = "bzlogger_32.dll" sequence here = find_resource(dll) atom hLogDLL = open_dll(here)
Example:
logger(LOG_INFO, find_resource("bzlog.conf"))
Log Message:
[INFO] [2025-06-21 09:49:06] C:\dev\bzscript_phix\lib\utils\bzlog.conf