The following code is from the get_filesystem_method() method in the wp-admin/includes/file.php file: if( function_exists('getmyuid') && function_exists('fileowner') ){ $temp_file = wp_tempnam(); if ( getmyuid() == fileowner($temp_file) ) $method = 'direct';