First working version of a FATFileSystem compatible Chan FAT v0.8 implementation. This is intended to use with long file names and RTOS support. For now long file names work but RTOS support is still untested.

Dependents:   USB_MSC USB_CDC_MSD_Hello TFTPServerTest DMXStation ... more

FATFileHandle.h

Committer:
NeoBelerophon
Date:
2011-02-04
Revision:
2:629e4be333f3
Parent:
0:8ea634413549

File content as of revision 2:629e4be333f3:

/* mbed Microcontroller Library - FATFileHandle
 * Copyright (c) 2008, sford
 */

#ifndef MBED_FATFILEHANDLE_H
#define MBED_FATFILEHANDLE_H

#include "FileHandle.h"
#include "ff.h"

namespace mbed {

class FATFileHandle : public FileHandle {
public:

    FATFileHandle(FIL_t fh);
    virtual int close();
    virtual ssize_t write(const void* buffer, size_t length);
    virtual ssize_t read(void* buffer, size_t length);
    virtual int isatty();
    virtual off_t lseek(off_t position, int whence);
    virtual int fsync();
    virtual off_t flen();

protected:

    FIL_t _fh;

};

}

#endif