function drush_file_not_empty

8.0.x filesystem.inc drush_file_not_empty($file_to_test)
6.x filesystem.inc drush_file_not_empty($file_to_test)
7.x filesystem.inc drush_file_not_empty($file_to_test)
4.x drush.inc drush_file_not_empty($file_to_test)
5.x filesystem.inc drush_file_not_empty($file_to_test)
master filesystem.inc drush_file_not_empty($file_to_test)

Test to see if a file exists and is not empty

2 calls to drush_file_not_empty()
drush_environment_table_inc in includes/environment.inc
_drush_download_file in includes/drush.inc
Download a file using wget, curl or file_get_contents. Does not use download cache.

File

includes/drush.inc, line 2896
The drush API implementation and helpers.

Code

function drush_file_not_empty($file_to_test) {
  if (file_exists($file_to_test)) {
    $stat = stat($file_to_test);
    if ($stat['size'] > 0) {
      return TRUE;
    }
  }
  return FALSE;
}