|
CS471/571 - Operating Systems
| Displaying exercises/e6/files/tree.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include "fs.h"
int lread(int bpos, void *buf, int size);
int readino(int ino, struct dinode *di);
char *readfile(struct dinode di, int *size);
int tree(int ino, int level);
struct superblock sb;
int fsfd;
char *type[] = {"?", "DIR ", "FILE", "DEV "};
int main(int argc, char *argv[])
{
if (argc < 2) {
printf("Usage:tree <image>\n");
return 1;
}
return 0;
}
/**
* Lists the directory given by ino, level determines the indentation level.
*/
int tree(int ino, int level)
{
}
/**
* Read the entire file given by the inode di into memory, returning it.
* "size" is optional, but set to the size of the file read.
*/
char *readfile(struct dinode di, int *size)
{
}
/**
* Reads the inode 'ino'
*/
int readino(int ino, struct dinode *di)
{
}
int lread(int bpos, void *buf, int size)
{
}
|