The use of combine_path and string-pasting with "." also looks unportable. Since not_query is a "UNIX style" path, it should be used with combine_path_unix. And the syntax for current directory is platform dependent. It should probably be something along the lines of:
string file = combine_path(getcwd(), combine_path_unix("/",X)[1..]);