attach stat to file and leverage that to get isDirectory()