*
* $Log: phatdir.c,v $
* Revision 1.11 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.10 2006/10/05 17:23:14 haraldkipp
* Fixes bug #1571269. Thanks to Dirk Boecker for reporting this.
*
* Revision 1.9 2006/09/08 16:48:28 haraldkipp
* Directory entries honor daylight saving time. Thanks to Dirk Boecker for
* this fix.
*
* Revision 1.8 2006/07/05 16:00:30 haraldkipp
* Two bugs fixed. Renaming a file's path (including directory change) failed.
* Thanks to Dirk Boecker, who reported this.
* The second bug was a memory hole, which had been discovered by
* Ralf Spettel.
*
* Revision 1.7 2006/06/28 17:24:29 haraldkipp
* Bugfix. Directories with long filename entries may not expand when
* crossing cluster boundaries.
*
* Revision 1.6 2006/06/18 16:37:10 haraldkipp
* No need to set errno after GetParentPath() returns an error.
* No need to set errno after malloc failed.
* New local helper function PhatOpenParentPath() reduces code size.
* Support for long filenames (VFAT) added.
* New function PhatDirReleaseChain() simplifies code.
* Static function PhatDirOpenParentPath() replaced by global PhatDirOpenParent().
* Added const attribute to path parameter of PhatDirOpen().
* Now PhatDirEntryUpdate() clears the dirty flag for the root directory.
* Calls to PhatFilePosSet() with position zero replaced by calls to PhatFilePosRewind().
*
* Revision 1.5 2006/04/07 12:52:24 haraldkipp
* Memory hole fixed. Flag for normal / directory files now set correctly.
*
* Revision 1.4 2006/02/23 15:45:21 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.3 2006/01/25 18:47:42 haraldkipp
* Fixes wrong implementation of readdir() and simplifies the code.
* Thanks to Jesper Hansen.
*
* Revision 1.2 2006/01/22 17:40:51 haraldkipp
* Now mkdir() fails, if the directory exists already.
* Now rmdir() returns an error when trying to delete subdirectories, which
* are not empty.
* Now PhatDirEntryStatus() sets correct errno value, if out of memory.
*
* Revision 1.1 2006/01/05 16:31:32 haraldkipp
* First check-in.
*
*
*
|
Defines |
|
#define | PHAT_MAXDIRENT 65536 |
| | Maximum number of directory entries.
|
Functions |
| int | PhatDirEntryCreate (NUTFILE *ndp, CONST char *name, int acc, PHATDIRENT *dirent) |
| | Create a new directory entry.
|
| int | PhatDirEntryUpdate (NUTFILE *nfp) |
| | Update directory entry of an opened file or directory.
|
| int | PhatDirEntryFind (NUTFILE *ndp, CONST char *spec, u_long attmsk, PHATFIND *srch) |
| | Find a directory entry with a specified name.
|
| NUTFILE * | PhatDirOpenParent (NUTDEVICE *dev, CONST char *path, CONST char **basename) |
| | Open parent directory of a given path.
|
| int | PhatDirRenameEntry (NUTDEVICE *dev, CONST char *old_path, CONST char *new_path) |
| | Rename file.
|
| int | PhatDirReleaseChain (NUTDEVICE *dev, PHATDIRENT *dent) |
| | Release a cluster chain of a specified directory entry.
|
| int | PhatDirDelEntry (NUTDEVICE *dev, CONST char *path, u_long flags) |
| | Remove a directory entry.
|
| NUTFILE * | PhatDirOpen (NUTDEVICE *dev, CONST char *dpath) |
| | Open a directory.
|
| int | PhatDirRead (DIR *dir) |
| | Read the next directory entry.
|
| int | PhatDirCreate (NUTDEVICE *dev, char *path) |
| | Create a new subdirectory.
|
| int | PhatDirRemove (NUTDEVICE *dev, char *path) |
| | Remove a specified subdirectory.
|
| int | PhatDirEntryStatus (NUTDEVICE *dev, CONST char *path, struct stat *stp) |
| | Retrieve status of a specified file.
|