add linkPath API
fix ELOOP emitted for files and not directories