is_a? vs respond_to?
Given that on some file systems a directory is simply a File with special attributes (or to put it another way a specialized file), does it really matter?  Unlink it if it can be unlinked if that is what you want to do.  If it can't be unlinked, why would you bother?  And why would you care what it is?  If you care what it is, then use is_a?  If the inode can be unlinked, unlink it.