add a function to check if a file is a directory

Signed-off-by: Sébastien Boisvert <sebastien.boisvert.3@ulaval.ca>