Add utils.isdir(fs,path,info) and utils.isfile(fs,path.info).
These helper functions can often tell the type of a path by inspecting the info dict (e.g. checking flags in st_mode) and can thus avoid an additional query to the filesystem. They fall back to calling fs.isdir() or fs.isfile() if the info dict doesn't give any clues.
Showing
Please
register
or
sign in
to comment