- Main Page
- Namespaces
- Data Structures
- Files
- Directories

- Search for |

- File List
- Globals

# vfs.cpp

Go to the documentation of this file.

    00001 #include <stdio.h>
    00002 #include "vfs.h"
    00003
    00004 DiskFS::DiskFS(const char * filename) {
    00005   diskFile = fopen(filename, "r+");
    00006 } // DiskFS::DiskFS
    00007
    00008 int
    00009 DiskFS::write(const void * data, long offset, long size) {
    00010   if (diskFile == NULL) return 1;
    00011   fseek(diskFile, offset, SEEK_SET);
    00012   fwrite(data, size, 1, diskFile);
    00013   return 0;
    00014 } // DiskFS::write
    00015
    00016 int
    00017 DiskFS::read(void * data, long offset, long size) {
    00018   if (diskFile == NULL) return 1;
    00019   fseek(diskFile, offset, SEEK_SET);
    00020   fread(data, size, 1, diskFile);
    00021   return 0;
    00022 } // DiskFS::read