Updated create file action to check for subdirectory existence before creation.