going back to the big if-elsif-else chain for the inode type as the dict method doesn't seem to work and I don't have the time to sort it out at the moment.