Index: includes/file.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/file.inc,v
retrieving revision 1.206
diff -u -p -r1.206 file.inc
--- includes/file.inc	26 Mar 2010 17:14:45 -0000	1.206
+++ includes/file.inc	5 Apr 2010 00:27:16 -0000
@@ -509,13 +509,13 @@ function file_save(stdClass $file) {
   $file->filesize = filesize($file->uri);
 
   if (empty($file->fid)) {
-    drupal_write_record('file', $file);
+    drupal_write_record('file_managed', $file);
     // Inform modules about the newly added file.
     module_invoke_all('file_insert', $file);
     entity_invoke('insert', 'file', $file);
   }
   else {
-    drupal_write_record('file', $file, 'fid');
+    drupal_write_record('file_managed', $file, 'fid');
     // Inform modules that the file has been updated.
     module_invoke_all('file_update', $file);
     entity_invoke('update', 'file', $file);
@@ -974,7 +974,7 @@ function file_delete(stdClass $file, $fo
   // Make sure the file is deleted before removing its row from the
   // database, so UIs can still find the file in the database.
   if (file_unmanaged_delete($file->uri)) {
-    db_delete('file')->condition('fid', $file->fid)->execute();
+    db_delete('file_managed')->condition('fid', $file->fid)->execute();
     return TRUE;
   }
   return FALSE;
@@ -1069,7 +1069,7 @@ function file_unmanaged_delete_recursive
  *   An integer containing the number of bytes used.
  */
 function file_space_used($uid = NULL, $status = FILE_STATUS_PERMANENT) {
-  $query = db_select('file', 'f');
+  $query = db_select('file_managed', 'f');
   // Use separate placeholders for the status to avoid a bug in some versions
   // of PHP. See http://drupal.org/node/352956.
   $query->where('f.status & :status1 = :status2', array(':status1' => $status, ':status2' => $status));
@@ -1083,9 +1083,9 @@ function file_space_used($uid = NULL, $s
 /**
  * Saves a file upload to a new location.
  *
- * The file will be added to the {file} table as a temporary file. Temporary
- * files are periodically cleaned. To make the file a permanent file, assign
- * the status and use file_save() to save the changes.
+ * The file will be added to the {file_managed} table as a temporary file.
+ * Temporary files are periodically cleaned. To make the file a permanent file,
+ * assign the status and use file_save() to save the changes.
  *
  * @param $source
  *   A string specifying the filepath or URI of the uploaded file to save.
@@ -1504,7 +1504,8 @@ function file_save_data($data, $destinat
  * Save a string to the specified destination without invoking file API.
  *
  * This function is identical to file_save_data() except the file will not be
- * saved to the {file} table and none of the file_* hooks will be called.
+ * saved to the {file_managed} table and none of the file_* hooks will be
+ * called.
  *
  * @param $data
  *   A string containing the contents of the file.
Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.448
diff -u -p -r1.448 form.inc
--- includes/form.inc	4 Apr 2010 13:22:51 -0000	1.448
+++ includes/form.inc	5 Apr 2010 00:27:16 -0000
@@ -197,8 +197,8 @@ function drupal_build_form($form_id, &$f
       // $menu_get_item() is not available at installation time.
       if (!isset($form_state['build_info']['file']) && !defined('MAINTENANCE_MODE')) {
         $item = menu_get_item();
-        if (!empty($item['file'])) {
-          $form_state['build_info']['file'] = $item['file'];
+        if (!empty($item['include_file'])) {
+          $form_state['build_info']['file'] = $item['include_file'];
         }
       }
 
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.383
diff -u -p -r1.383 menu.inc
--- includes/menu.inc	26 Mar 2010 17:14:45 -0000	1.383
+++ includes/menu.inc	5 Apr 2010 00:27:17 -0000
@@ -463,8 +463,8 @@ function menu_execute_active_handler($pa
       // to make alterations just for this request.
       drupal_alter('menu_active_handler', $router_item, $path);
       if ($router_item['access']) {
-        if ($router_item['file']) {
-          require_once DRUPAL_ROOT . '/' . $router_item['file'];
+        if ($router_item['include_file']) {
+          require_once DRUPAL_ROOT . '/' . $router_item['include_file'];
         }
         $page_callback_result = call_user_func_array($router_item['page_callback'], $router_item['page_arguments']);
       }
@@ -3271,7 +3271,7 @@ function _menu_router_save($menu, $masks
       'description',
       'position',
       'weight',
-      'file',
+      'include_file',
     ));
 
   $num_records = 0;
@@ -3302,7 +3302,7 @@ function _menu_router_save($menu, $masks
       'description' => $item['description'],
       'position' => $item['position'],
       'weight' => $item['weight'],
-      'file' => $item['include file'],
+      'include_file' => $item['include file'],
     ));
 
     // Execute in batches to avoid the memory overhead of all of those records
Index: modules/simpletest/tests/file.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file.test,v
retrieving revision 1.51
diff -u -p -r1.51 file.test
--- modules/simpletest/tests/file.test	29 Jan 2010 22:40:41 -0000	1.51
+++ modules/simpletest/tests/file.test	5 Apr 2010 00:27:17 -0000
@@ -194,7 +194,7 @@ class FileTestCase extends DrupalWebTest
     $file->status = 0;
     // Write the record directly rather than calling file_save() so we don't
     // invoke the hooks.
-    $this->assertNotIdentical(drupal_write_record('file', $file), FALSE, t('The file was added to the database.'), 'Create test file');
+    $this->assertNotIdentical(drupal_write_record('file_managed', $file), FALSE, t('The file was added to the database.'), 'Create test file');
 
     return $file;
   }
@@ -289,21 +289,21 @@ class FileSpaceUsedTest extends FileTest
 
     // Create records for a couple of users with different sizes.
     $file = array('uid' => 2, 'uri' => 'public://example1.txt', 'filesize' => 50, 'status' => FILE_STATUS_PERMANENT);
-    drupal_write_record('file', $file);
+    drupal_write_record('file_managed', $file);
     $file = array('uid' => 2, 'uri' => 'public://example2.txt', 'filesize' => 20, 'status' => FILE_STATUS_PERMANENT);
-    drupal_write_record('file', $file);
+    drupal_write_record('file_managed', $file);
     $file = array('uid' => 3, 'uri' => 'public://example3.txt', 'filesize' => 100, 'status' => FILE_STATUS_PERMANENT);
-    drupal_write_record('file', $file);
+    drupal_write_record('file_managed', $file);
     $file = array('uid' => 3, 'uri' => 'public://example4.txt', 'filesize' => 200, 'status' => FILE_STATUS_PERMANENT);
-    drupal_write_record('file', $file);
+    drupal_write_record('file_managed', $file);
 
     // Now create some with other statuses. These values were chosen arbitrarily
     // for the sole purpose of testing that bitwise operators were used
     // correctly on the field.
     $file = array('uid' => 2, 'uri' => 'public://example5.txt', 'filesize' => 1, 'status' => 2 | 8);
-    drupal_write_record('file', $file);
+    drupal_write_record('file_managed', $file);
     $file = array('uid' => 3, 'uri' => 'public://example6.txt', 'filesize' => 3, 'status' => 2 | 4);
-    drupal_write_record('file', $file);
+    drupal_write_record('file_managed', $file);
   }
 
   /**
@@ -560,7 +560,7 @@ class FileSaveUploadTest extends FileHoo
     $this->image = current($this->drupalGetTestFiles('image'));
     $this->assertTrue(is_file($this->image->uri), t("The file we're going to upload exists."));
 
-    $this->maxFidBefore = db_query('SELECT MAX(fid) AS fid FROM {file}')->fetchField();
+    $this->maxFidBefore = db_query('SELECT MAX(fid) AS fid FROM {file_managed}')->fetchField();
 
     // Upload with replace to gurantee there's something there.
     $edit = array(
@@ -581,7 +581,7 @@ class FileSaveUploadTest extends FileHoo
    * Test the file_save_upload() function.
    */
   function testNormal() {
-    $max_fid_after = db_query('SELECT MAX(fid) AS fid FROM {file}')->fetchField();
+    $max_fid_after = db_query('SELECT MAX(fid) AS fid FROM {file_managed}')->fetchField();
     $this->assertTrue($max_fid_after > $this->maxFidBefore, t('A new file was created.'));
     $file1 = file_load($max_fid_after);
     $this->assertTrue($file1, t('Loaded the file.'));
@@ -592,13 +592,13 @@ class FileSaveUploadTest extends FileHoo
     file_test_reset();
 
     // Upload a second file.
-    $max_fid_before = db_query('SELECT MAX(fid) AS fid FROM {file}')->fetchField();
+    $max_fid_before = db_query('SELECT MAX(fid) AS fid FROM {file_managed}')->fetchField();
     $image2 = current($this->drupalGetTestFiles('image'));
     $edit = array('files[file_test_upload]' => drupal_realpath($image2->uri));
     $this->drupalPost('file-test/upload', $edit, t('Submit'));
     $this->assertResponse(200, t('Received a 200 response for posted test file.'));
     $this->assertRaw(t('You WIN!'));
-    $max_fid_after = db_query('SELECT MAX(fid) AS fid FROM {file}')->fetchField();
+    $max_fid_after = db_query('SELECT MAX(fid) AS fid FROM {file_managed}')->fetchField();
 
     // Check that the correct hooks were called.
     $this->assertFileHooksCalled(array('validate', 'insert'));
@@ -1680,7 +1680,7 @@ class FileSaveTest extends FileHookTestC
 
     $this->assertNotNull($saved_file, t("Saving the file should give us back a file object."), 'File');
     $this->assertTrue($saved_file->fid > 0, t("A new file ID is set when saving a new file to the database."), 'File');
-    $loaded_file = db_query('SELECT * FROM {file} f WHERE f.fid = :fid', array(':fid' => $saved_file->fid))->fetch(PDO::FETCH_OBJ);
+    $loaded_file = db_query('SELECT * FROM {file_managed} f WHERE f.fid = :fid', array(':fid' => $saved_file->fid))->fetch(PDO::FETCH_OBJ);
     $this->assertNotNull($loaded_file, t("Record exists in the database."));
     $this->assertEqual($loaded_file->status, $file->status, t("Status was saved correctly."));
     $this->assertEqual($saved_file->filesize, filesize($file->uri), t("File size was set correctly."), 'File');
@@ -1697,7 +1697,7 @@ class FileSaveTest extends FileHookTestC
 
     $this->assertEqual($resaved_file->fid, $saved_file->fid, t("The file ID of an existing file is not changed when updating the database."), 'File');
     $this->assertTrue($resaved_file->timestamp >= $saved_file->timestamp, t("Timestamp didn't go backwards."), 'File');
-    $loaded_file = db_query('SELECT * FROM {file} f WHERE f.fid = :fid', array(':fid' => $saved_file->fid))->fetch(PDO::FETCH_OBJ);
+    $loaded_file = db_query('SELECT * FROM {file_managed} f WHERE f.fid = :fid', array(':fid' => $saved_file->fid))->fetch(PDO::FETCH_OBJ);
     $this->assertNotNull($loaded_file, t("Record still exists in the database."), 'File');
     $this->assertEqual($loaded_file->status, $saved_file->status, t("Status was saved correctly."));
   }
Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.149
diff -u -p -r1.149 system.api.php
--- modules/system/system.api.php	4 Apr 2010 12:48:18 -0000	1.149
+++ modules/system/system.api.php	5 Apr 2010 00:27:17 -0000
@@ -1779,7 +1779,7 @@ function hook_file_download($uri) {
   if (!file_prepare_directory($uri)) {
     $uri = FALSE;
   }
-  $result = db_query("SELECT f.* FROM {file} f INNER JOIN {upload} u ON f.fid = u.fid WHERE uri = :uri", array('uri' => $uri));
+  $result = db_query("SELECT f.* FROM {file_managed} f INNER JOIN {upload} u ON f.fid = u.fid WHERE uri = :uri", array('uri' => $uri));
   foreach ($result as $file) {
     if (!user_access('view uploaded files')) {
       return -1;
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.460
diff -u -p -r1.460 system.install
--- modules/system/system.install	28 Mar 2010 11:45:11 -0000	1.460
+++ modules/system/system.install	5 Apr 2010 00:27:18 -0000
@@ -692,7 +692,7 @@ function system_schema() {
     'primary key' => array('type', 'language'),
   );
 
-  $schema['file'] = array(
+  $schema['file_managed'] = array(
     'description' => 'Stores information for uploaded files.',
     'fields' => array(
       'fid' => array(
@@ -983,10 +983,10 @@ function system_schema() {
         'not null' => TRUE,
         'default' => 0,
       ),
-      'file' => array(
+      'include_file' => array(
         'description' => 'The file to include for this element, usually the page callback function lives in this file.',
         'type' => 'text',
-        'size' => 'medium'
+        'size' => 'medium',
       ),
     ),
     'indexes' => array(
@@ -2094,7 +2094,7 @@ function system_update_7033() {
 }
 
 /**
- * Migrate the file_downloads setting and create the new {file} table.
+ * Migrate the file_downloads setting and create the new {file_managed} table.
  */
 function system_update_7034() {
   $files_directory = variable_get('file_directory_path', NULL);
@@ -2112,7 +2112,7 @@ function system_update_7034() {
   }
   variable_del('file_downloads');
 
-  $schema['file'] = array(
+  $schema['file_managed'] = array(
     'description' => 'Stores information for uploaded files.',
     'fields' => array(
       'fid' => array(
@@ -2181,11 +2181,11 @@ function system_update_7034() {
     'primary key' => array('fid'),
   );
 
-  db_create_table('file', $schema['file']);
+  db_create_table('file_managed', $schema['file_managed']);
 }
 
 /**
- * Migrate upload module files to the new {file} table.
+ * Migrate upload module files to the new {file_managed} table.
  */
 function system_update_7035() {
   if (!db_table_exists('upload')) {
@@ -2205,7 +2205,7 @@ function system_update_7035() {
   foreach ($result as $file) {
     $file['uri'] = $scheme . str_replace($basename, '', $file['uri']);
     $file['uri'] = file_stream_wrapper_uri_normalize($file['uri']);
-    db_insert('file')->fields($file)->execute();
+    db_insert('file_managed')->fields($file)->execute();
     $fids[] = $file['fid'];
   }
   // TODO: delete the found fids from {files}?
@@ -2391,6 +2391,13 @@ function system_update_7051() {
 }
 
 /**
+ * Rename file to include_file in {menu_router} table.
+ */
+function system_update_7052() {
+  db_change_field('menu_router', 'file', 'include_file', array('type' => 'text', 'size' => 'medium'));
+}
+
+/**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.916
diff -u -p -r1.916 system.module
--- modules/system/system.module	1 Apr 2010 14:47:16 -0000	1.916
+++ modules/system/system.module	5 Apr 2010 00:27:18 -0000
@@ -260,7 +260,7 @@ function system_entity_info() {
   return array(
     'file' => array(
       'label' => t('File'),
-      'base table' => 'file',
+      'base table' => 'file_managed',
       'entity keys' => array(
         'id' => 'fid',
       ),
@@ -2779,7 +2779,7 @@ function system_cron() {
   // Remove temporary files that are older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
   // Use separate placeholders for the status to avoid a bug in some versions
   // of PHP. See http://drupal.org/node/352956.
-  $result = db_query('SELECT fid FROM {file} WHERE status & :permanent1 <> :permanent2 AND timestamp < :timestamp', array(
+  $result = db_query('SELECT fid FROM {file_managed} WHERE status & :permanent1 <> :permanent2 AND timestamp < :timestamp', array(
     ':permanent1' => FILE_STATUS_PERMANENT,
     ':permanent2' => FILE_STATUS_PERMANENT,
     ':timestamp' => REQUEST_TIME - DRUPAL_MAXIMUM_TEMP_FILE_AGE
Index: modules/system/system.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.test,v
retrieving revision 1.118
diff -u -p -r1.118 system.test
--- modules/system/system.test	31 Mar 2010 19:10:39 -0000	1.118
+++ modules/system/system.test	5 Apr 2010 00:27:19 -0000
@@ -469,7 +469,7 @@ class CronRunTestCase extends DrupalWebT
   function testTempFileCleanup() {
     // Temporary file that is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
     $temp_old = file_save_data('');
-    db_update('file')
+    db_update('file_managed')
       ->fields(array(
         'status' => 0,
         'timestamp' => 1,
@@ -480,7 +480,7 @@ class CronRunTestCase extends DrupalWebT
 
     // Temporary file that is less than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
     $temp_new = file_save_data('');
-    db_update('file')
+    db_update('file_managed')
       ->fields(array('status' => 0))
       ->condition('fid', $temp_new->fid)
       ->execute();
@@ -488,7 +488,7 @@ class CronRunTestCase extends DrupalWebT
 
     // Permanent file that is older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
     $perm_old = file_save_data('');
-    db_update('file')
+    db_update('file_managed')
       ->fields(array('timestamp' => 1))
       ->condition('fid', $temp_old->fid)
       ->execute();
Index: modules/user/user.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.install,v
retrieving revision 1.43
diff -u -p -r1.43 user.install
--- modules/user/user.install	28 Mar 2010 11:45:11 -0000	1.43
+++ modules/user/user.install	5 Apr 2010 00:27:19 -0000
@@ -201,7 +201,7 @@ function user_schema() {
         'type' => 'int',
         'not null' => TRUE,
         'default' => 0,
-        'description' => "Foreign key: {file}.fid of user's picture.",
+        'description' => "Foreign key: {file_managed}.fid of user's picture.",
       ),
       'init' => array(
         'type' => 'varchar',
@@ -473,7 +473,8 @@ function user_update_7003() {
 }
 
 /**
- * Add the user's pictures to the {file} table and make them managed files.
+ * Add the user's pictures to the {file_managed} table and make them managed
+ * files.
  */
 function user_update_7004(&$sandbox) {
 
@@ -481,7 +482,7 @@ function user_update_7004(&$sandbox) {
     'type' => 'int',
     'not null' => TRUE,
     'default' => 0,
-    'description' => t("Foreign key: {file}.fid of user's picture."),
+    'description' => t("Foreign key: {file_managed}.fid of user's picture."),
   );
 
   if (!isset($sandbox['progress'])) {
@@ -498,8 +499,8 @@ function user_update_7004(&$sandbox) {
     $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE picture <> ''")->fetchField();
   }
 
-  // As a batch operation move the photos into the {file} table and update the
-  // {users} records.
+  // As a batch operation move the photos into the {file_managed} table and
+  // update the {users} records.
   $limit = 500;
   $result = db_query_range("SELECT uid, picture FROM {users} WHERE picture <> '' AND uid > :uid ORDER BY uid", 0, $limit, array(':uid' => $sandbox['last_user_processed']));
   foreach ($result as $user) {
