search path can be a directory or a file