The function PL_get_file_name() provides access to Prolog filenames and its file-search mechanism described with absolute_file_name/3. Its existence is motivated to realise a uniform interface to deal with file properties, search, naming conventions, etc., from foreign code.
BUF_STACK, which is popped upon return from the 
foreign predicate to Prolog. Conversion from the internal UNICODE 
encoding is done using standard C library functions. flags is 
a bit-mask controlling the conversion process. On failure, PL_FILE_NOERRORS 
controls whether an exception is raised. Options are:
PL_FILE_ABSOLUTEPL_FILE_OSPATH\/PL_FILE_SEARCHPL_FILE_EXISTPL_FILE_READPL_FILE_WRITEPL_FILE_EXECUTEPL_FILE_NOERRORSPL_FILE_OSPATH must be provided to fetch a 
filename in OS native (e.g., C:\x\y) notation.