1 #ifndef FILESYS_DIRECTORY_H
2 #define FILESYS_DIRECTORY_H
6 #include "devices/disk.h"
8 /* Maximum length of a file name component.
9 This is the traditional UNIX maximum length.
10 After directories are implemented, this maximum length may be
11 retained, but much longer full path names must be allowed. */
15 bool dir_create (disk_sector_t sector, size_t entry_cnt);
16 struct dir *dir_open (struct inode *);
17 struct dir *dir_open_root (void);
18 struct dir *dir_reopen (struct dir *);
19 void dir_close (struct dir *);
20 struct inode *dir_get_inode (struct dir *);
21 bool dir_lookup (const struct dir *, const char *name, struct inode **);
22 bool dir_add (struct dir *, const char *name, disk_sector_t);
23 bool dir_remove (struct dir *, const char *name);
24 bool dir_readdir (struct dir *, char name[NAME_MAX + 1]);
26 #endif /* filesys/directory.h */