1#ifndef FILESYS_DIRECTORY_H
2#define FILESYS_DIRECTORY_H
uint32_t block_sector_t
Index of a block device sector.
struct dir * dir_open(struct inode *)
Opens and returns the directory for the given INODE, of which it takes ownership.
struct inode * dir_get_inode(struct dir *)
Returns the inode encapsulated by DIR.
struct dir * dir_reopen(struct dir *)
Opens and returns a new directory for the same inode as DIR.
bool dir_readdir(struct dir *, char name[NAME_MAX+1])
filesys/directory.h
bool dir_remove(struct dir *, const char *name)
Removes any entry for NAME in DIR.
void dir_close(struct dir *)
Destroys DIR and frees associated resources.
bool dir_add(struct dir *, const char *name, block_sector_t)
Adds a file named NAME to DIR, which must not already contain a file by that name.
bool dir_create(block_sector_t sector, size_t entry_cnt)
Opening and closing directories.
#define NAME_MAX
Maximum length of a file name component.
bool dir_lookup(const struct dir *, const char *name, struct inode **)
Reading and writing.
struct dir * dir_open_root(void)
Opens the root directory and returns a directory for it.
block_sector_t sector
Sector number of disk location.