Returns objects for directories and strings for files