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

Related topics

3 calls to drush_file_not_empty()
drush_core_pre_site_install in commands/core/site_install.drush.inc
Perform setup tasks for installation.
_drush_download_file in includes/drush.inc
Download a file using wget, curl or file_get_contents. Does not use download cache.
_drush_sync_via_http_download_file in examples/sync_via_http.drush.inc
Downloads a files.

File

includes/filesystem.inc, line 624
Filesystem utilities.

Code

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