Move writing of pref file in file_node.