function drush_file_not_empty
| 6.x filesystem.inc | drush_file_not_empty($file_to_test) |
| 5.x filesystem.inc | drush_file_not_empty($file_to_test) |
| 4.x drush.inc | drush_file_not_empty($file_to_test) |
Test to see if a file exists and is not empty
Related topics
5 calls to drush_file_not_empty()
- drush_core_pre_site_install in commands/
core/ site_install.drush.inc - Perform setup tasks for installation.
- drush_core_runserver_validate in commands/
runserver/ runserver.drush.inc - Validate callback for runserver command.
- drush_environment_table_lib 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.
- _drush_sync_via_http_download_file in examples/
sync_via_http.drush.inc - Download a file, optionaly with user authentication, using either wget or curl, as available.
File
- includes/
filesystem.inc, line 580
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;
}