Nut/OS  4.10.3
API Reference
phatfs.c File Reference

PHAT File System. More...

#include <fs/fs.h>
#include <dirent.h>
#include <dev/blockdev.h>
#include <sys/event.h>
#include <fs/phatfs.h>
#include <fs/phatvol.h>
#include <fs/phatio.h>
#include <fs/phatutil.h>
#include <fs/phatdir.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <memdebug.h>
Include dependency graph for phatfs.c:

Go to the source code of this file.

Defines

#define SEEK_SET   0
#define SEEK_CUR   1
#define SEEK_END   2

Functions

uint32_t AllocFirstCluster (NUTFILE *nfp)
 Allocate the first cluster of a file.
int PhatFileClose (NUTFILE *nfp)
 Close a file.
NUTFILEPhatFileOpen (NUTDEVICE *dev, CONST char *path, int mode, int acc)
 Open a file.
int PhatFileWrite (NUTFILE *nfp, CONST void *buffer, int len)
 Write data to a file.
int PhatFileWrite_P (NUTFILE *nfp, PGM_P buffer, int len)
 Write data from program space to a file.
int PhatFileRead (NUTFILE *nfp, void *buffer, int size)
 Read data from a file.

Variables

NUTDEVICE devPhat0
 PHAT file system driver information structure.
NUTDEVICE devPhat1

Detailed Description

PHAT File System.

 *
 * $Log$
 * Revision 1.15  2009/02/13 14:52:05  haraldkipp
 * Include memdebug.h for heap management debugging support.
 *
 * Revision 1.14  2008/08/25 14:26:32  haraldkipp
 * Append to existing files failed when file size was larger than one cluster.
 *
 * Revision 1.13  2008/08/22 16:22:22  olereinhardt
 * Check if filesystem is mounted when opening a file.
 * Prevents a system lockup because of a nullpointer access
 *
 * Revision 1.12  2008/08/11 06:59:42  haraldkipp
 * BSD types replaced by stdint types (feature request #1282721).
 *
 * Revision 1.11  2008/04/02 09:39:29  haraldkipp
 * Fixed another PHAT file pointer bug.
 *
 * Revision 1.10  2008/04/01 10:14:58  haraldkipp
 * Fixes bug #1903303. Still not fully correct, because fopen(name, "a+")
 * should set the read pointer at position 0 while all writes should go
 * to the end of the file. But setting the write pointer at the end will
 * work for now.
 *
 * Revision 1.9  2006/10/08 16:42:56  haraldkipp
 * Not optimal, but simple and reliable exclusive access implemented.
 * Fixes bug #1486539. Furthermore, bug #1567790, which had been rejected,
 * had been reported correctly and is now fixed.
 *
 * Revision 1.8  2006/07/11 12:20:57  haraldkipp
 * Added mutual exclusion protection during flush.
 * Honor Nut/OS file flushing, which uses a NULL pointer on read/write.
 *
 * Revision 1.7  2006/07/05 16:02:23  haraldkipp
 * Typically Nut/OS doesn't check parameters, but this one is missed often,
 * closing a file which points to NUTFILE_EOF.
 *
 * Revision 1.6  2006/06/18 16:38:28  haraldkipp
 * No need to set errno after malloc failed.
 * Support for long filenames (VFAT) added.
 * New function PhatDirReleaseChain() simplifies code.
 * Fixed positioning bug, which caused several problems like limiting
 * directories to one cluster.
 *
 * Revision 1.5  2006/05/15 11:47:18  haraldkipp
 * Added support for file seek.
 *
 * Revision 1.4  2006/03/02 19:59:05  haraldkipp
 * Added implementation of dev_size makes _filelength() work, which in turn
 * enables the use of these file systems in pro/httpd.c.
 *
 * Revision 1.3  2006/02/23 15:45:22  haraldkipp
 * PHAT file system now supports configurable number of sector buffers.
 * This dramatically increased write rates of no-name cards.
 * AVR compile errors corrected.
 *
 * Revision 1.2  2006/01/22 17:42:08  haraldkipp
 * Now file delete requests fail if used on directory entries.
 *
 * Revision 1.1  2006/01/05 16:31:39  haraldkipp
 * First check-in.
 *
 *
 * 

Definition in file phatfs.c.


Define Documentation

#define SEEK_SET   0

Definition at line 132 of file phatfs.c.

#define SEEK_CUR   1

Definition at line 133 of file phatfs.c.

#define SEEK_END   2

Definition at line 134 of file phatfs.c.