Wrap write call in Pathname.