add ec_file:is_dir/1 and use it to identify what a real directory is