How to write a new file when new post has been published in WordPress

Where you pass post id ?

 $content = htmlentities(get_post_field('post_content', $post_ID));

techhipbettruvabetnorabahisbahis forumutaraftarium24eduedueduedueduseduseduedusedusedus