Remember to cast file to path before comparing paths