rather than EPERM; to emulate this properly, translate the error to EISDIR if the target patch exists and points to a directory this fixes the 'ant clean' problem reported by Marc Recht on current-users@ with SuSE 9.1 libraries