TacOS
0.2
|
Fonctions pour le driver FAT. Plus de détails...
#include <fs/fat.h>
#include <kdirent.h>
#include <kfcntl.h>
#include <kstat.h>
#include <klibc/string.h>
#include <klog.h>
#include <kmalloc.h>
#include <kerrno.h>
#include <types.h>
#include "fat_outils.h"
#include "fat_internal.c"
Fonctions | |
dentry_t * | fat_getroot (struct _fs_instance_t *instance) |
dentry_t * | fat_lookup (struct _fs_instance_t *instance, struct _dentry_t *dentry, const char *name) |
int | fat_readdir (open_file_descriptor *ofd, char *entries, size_t size) |
int | fat_seek_file (open_file_descriptor *ofd, long offset, int whence) |
ssize_t | fat_read_file (open_file_descriptor *ofd, void *buf, size_t count) |
int | fat_mkdir (fs_instance_t *instance, const char *path, mode_t mode) |
int | fat_open (open_file_descriptor *ofd) |
int | fat_close (open_file_descriptor *ofd) |
int | fat_unlink (fs_instance_t *instance, const char *path) |
Copyright (C) 2010-2014 TacOS developers.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/copyleft/gpl.html
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses.
int fat_close | ( | open_file_descriptor * | ofd | ) |
Fermeture d'un fichier ouvert.
ofd | Descripteur de fichier ouvert. |
dentry_t* fat_getroot | ( | struct _fs_instance_t * | instance | ) |
Fonction qui permet de récupérer le dentry à la racine.
instance | Instance de FS. |
dentry_t* fat_lookup | ( | struct _fs_instance_t * | instance, |
struct _dentry_t * | dentry, | ||
const char * | name | ||
) |
Fonction de lookup : retourne l'entrée de dossier qui correspond au nom demandé.
instance | Instance de FS. |
dentry | Dossier parent. |
name | Nom de l'entrée dans ce dossier. |
int fat_mkdir | ( | fs_instance_t * | instance, |
const char * | path, | ||
mode_t | mode | ||
) |
Création d'un dossier.
instance | Instance de fs. |
path | Chemin du dossier à créer. |
mode | Droits sur le dossier. |
int fat_open | ( | open_file_descriptor * | ofd | ) |
Ouverture d'un fichier. Initialise certaines données de l'ofd.
ofd | Descripteur de fichier ouvert. |
ssize_t fat_read_file | ( | open_file_descriptor * | ofd, |
void * | buf, | ||
size_t | count | ||
) |
Lecture d'un fichier.
ofd | Descripteur du fichier ouvert. |
buf | Buffer où stocker les octets lus. |
count | Nombre d'octets à lire. |
int fat_readdir | ( | open_file_descriptor * | ofd, |
char * | entries, | ||
size_t | size | ||
) |
Lecture d'un dossier.
ofd | Descripteur de fichier qui correspond au dossier. |
entries | Buffer qui va recevoir les entrées de dossier. |
size | Nombre d'octets dans le buffer au maximum. |
int fat_seek_file | ( | open_file_descriptor * | ofd, |
long | offset, | ||
int | whence | ||
) |
Déplacement dans un fichier.
ofd | Descripteur de fichier ouvert. |
offset | Décalage |
whence | depuis le debut, la fin ou en relatif. |
int fat_unlink | ( | fs_instance_t * | instance, |
const char * | path | ||
) |
Suppression d'un fichier ou dossier (vide).
instance | Instance de fs. |
path | Chemin du noeud. |