make resourceToFile multiplatform friendly