Loading...
Searching...
No Matches
disk.c File Reference
`#include "disk.h"`
`#include "struct.h"`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <unistd.h>`
Include dependency graph for disk.c:

## Functions

int | init_inode_in_disk (disk *d, int inode_index, int filetype, unsigned short perms, int owned_bloc)
disk | create_disk ()
| Créer un fichier "disk" de taille MAX_BYTES_PER_BLOC * MAX_BLOCS, renvoi ce disque.
disk | open_disk (char *filename)
| Si un fichier filename existe, alors on le lit et le stocke en mémoire.
int | find_free_bloc (disk *d)
int | find_offset_in_parent_bloc (bloc *parent_bloc)
void | create_directory (disk *disk, inode *parent, char *dirname)
void | create_file (disk *disk, inode *parent, char *filename)
void | create_inode (disk *disk, inode *parent, char inode_type, char *name)

## Function Documentation

## create_directory()

void create_directory | ( | disk * | disk,
|  | inode * | parent,
|  | char * | dirname
| ) |  |

## create_disk()

disk create_disk | ( |  | ) |

Créer un fichier "disk" de taille MAX_BYTES_PER_BLOC * MAX_BLOCS, renvoi ce disque.

Returns
  Le disque créé

## create_file()

void create_file | ( | disk * | disk,
|  | inode * | parent,
|  | char * | filename
| ) |  |

## create_inode()

void create_inode | ( | disk * | disk,
|  | inode * | parent,
|  | char | inode_type,
|  | char * | name
| ) |  |

## find_free_bloc()

int find_free_bloc | ( | disk * | d | ) |

## find_offset_in_parent_bloc()

int find_offset_in_parent_bloc | ( | bloc * | parent_bloc | ) |

## init_inode_in_disk()

int init_inode_in_disk | ( | disk * | d,
|  | int | inode_index,
|  | int | filetype,
|  | unsigned short | perms,
|  | int | owned_bloc
| ) |  |

## open_disk()

disk open_disk | ( | char * | filename | ) |

Si un fichier filename existe, alors on le lit et le stocke en mémoire.

Parameters

  char | *filename Le nom du fichier à lire

Returns
  Le disque lu