$file already does all those things for directories except for size