The above looks wrong, it should be "ByDeletingLastPathComponent"