file_set_status($file, $status = FILE_STATUS_PERMANENT)
drupal-cvs/includes/file.inc, line 879
Set the status of a file.
$file A Drupal file object.
$status A status value to set the file to.
File object if the change is successful, or FALSE in the event of an error.
| Name | Description |
|---|---|
| File interface | Common file handling functions. |
<?php
function file_set_status($file, $status = FILE_STATUS_PERMANENT) {
if (db_query('UPDATE {files} SET status = %d WHERE fid = %d', array($status, $file->fid))) {
$file->status = $status;
return TRUE;
}
return FALSE;
}
?>