1. Find Resource

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 

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu