def file_exists(fname):
try:<EOL><INDENT>return fname and os.path.exists(fname) and os.path.getsize(fname) > <NUM_LIT:0><EOL><DEDENT>except OSError:<EOL><INDENT>return False<EOL><DEDENT>
Check if a file exists and is non-empty.