+#include "filesys/file.h"
+#include <debug.h>
+#include <string.h>
+#include "filesys/directory.h"
+#include "filesys/inode.h"
+#include "filesys/filesys.h"
+#include "threads/malloc.h"
+
+/* An open file. */
+struct file
+ {
+ struct inode *inode; /* File's inode. */
+ uint8_t *bounce; /* Bounce buffer for reads and writes. */
+ off_t pos; /* Current position. */
+ };
+
+/* Opens and returns the file whose inode is in sector
+ INODE_SECTOR. Returns a null pointer if unsuccessful. */
+struct file *
+file_open (disk_sector_t inode_sector)