Oh, we are in the query group, aren't we.
It will not work by itself in a query. You can use a query in a function,
but you have to be aware of the behaviour. If you use a function in a query
and don't pass it field in the query, the query will only execute one time.
To get the query to execute for each line, you have to pass a field. This
doesn't mean the function has to use it, it just means it will cause it to
exeute for each row. You could write your own function that calls the Dir
function, but it has some behaviour that will make it tricky to deal with.