fulldir.m: more robust and more similar to dir