check for tilda at end of filename