entity_metadata_wrapper file load
Some corrections after, can you put the context of the execution? Like the function where you call this code and where you output $file variable?

$wrapper = entity_metadata_wrapper('node',$variables['node']);
// raw() should give you file object in your case
$file_field= $wrapper-&gt;field_library_file-&gt;raw();
// theme_file_link 'file' parameters have to be a file object 
$variables['file'] = theme('file_link', array('file' =&gt; $file_field ));


Docs :


theme('file_link') OR theme_file_link
Raw() Method


Note :

@clive comment : no need to value() because he have already used that function below, if we follow the source code given... In that case, value() and raw() methods should return the same file object.

theme('file_link', array('file' =&gt; $file_field))


Edit : Can you dump your $file_field variable? You can do it via this snippet

drupal_set_message('&lt;pre&gt;'.print_r($file_field, true).'&lt;/pre&gt;');