write file from Prolog