Site icon Hip-Hop Website Design and Development

Conditional for autosave or auto draft?

I am attempting to create a file using fopen() on save_post. I am having trouble finding the right condtionals to prevent the the file from being created from an auto save. I only want to create the file when I click publish the post. Currently the file is created when I click “add new” and when I fill in the title.

I have tried several combinations using wp_is_post_revision() and wp_is_post_autosave() any help would be appreciated.