entity_metadata_wrapper file load I'm trying to load and get the file using entity_metadata_wrapper. this is my code

$wrapper = entity_metadata_wrapper('node',$variables['node']);
$file_field= $wrapper-&gt;field_library_file-&gt;value();
$variables['file'] = theme('file_link', array('file' =&gt; file_load($file_field['fid'])));


and &lt;?php print $file;?&gt; outputs nothing. I've found this in this address . how can I get set of files that belongs to a node.

thanks.



UPDATE:

this is the code I use for theme hook suggestion, this code is on top of the the above code.

$suggest = "page__node__library";
$variables['theme_hook_suggestions'][] = $suggest;


I created a page and renamed it to page--node--library.tpl.php and &lt;?php print $file;?&gt; is in this page.
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;');