group/pintos/src/filesys/directory.c
/* Searches DIR for a file with the given NAME
   and returns true if one exists, false otherwise.
   On success, sets *INODE to an inode for the file, otherwise to
   a null pointer.  The caller must close *INODE. */
Searches DIR for a file with the given NAME
and returns true if one exists, false otherwise.
On success, sets *INODE to an inode for the file, otherwise to
a null pointer.  The caller must close *INODE.
Searches DIR for a file with the given NAME and returns true if one exists false otherwise . On success sets * INODE to an inode for the file otherwise to a null pointer . The caller must close * INODE .
bool
dir_lookup (const struct dir *dir, const char *name,
            struct inode **inode)
{
  struct dir_entry e;
  ASSERT (dir != NULL);
  ASSERT (name != NULL);
  if (lookup (dir, name, &e, NULL))
    *inode = inode_open (e.inode_sector);
  else
    *inode = NULL;
  return *inode != NULL;
}
bool dir_lookup ( const struct dir * dir , const char * name , struct inode * * inode ) { struct dir_entry e ; ASSERT ( dir != NULL ) ; ASSERT ( name != NULL ) ; if ( lookup ( dir , name , & e , NULL ) ) * inode = inode_open ( e . inode_sector ) ; else * inode = NULL ; return * inode != NULL ; }
Searches DIR for a file with the given NAME
and returns true if one exists, false otherwise.
Searches DIR for a file with the given NAME and returns true if one exists false otherwise .