Home $5K RTOS Bundle Technical Support The Blunk Difference Contact Us

File System User API

Blunk Microsystems' file system API includes the file-related routines from Standard C and POSIX, as well as a number of non-standard functions that either meet a need unique to embedded systems programming or provide a convenience or optimization. The supplied library supports all commonly needed file operations.

Either 'posix.h' or 'stdio.h' must be included to use the routines, as indicated on the user's guide. Except for rename(), the Standard C API is a subset of the POSIX API in regard to functionality. There is some overlap. For example, write() from the POSIX API is similar to the Standard C fwrite(). The directory-related routines (mkdir(), etc.) are all from the POSIX API.

In the following functional grouping, the API routine names are color-coded based on whether a stream handle ("FILE *"), descriptor ("int"), pathname, or neither is used to specify the file they act on.

Descriptor-Stream Conversion

       fdopen() - convert descriptor to stream
       fileno() - convert stream to descriptor

Directory Management

        chdir() - change working directory
     closedir() - close directory list
       frstat() - fstat() with directory size
       getcwd() - get current working directory
        mkdir() - create new directory
      opendir() - open directory list
      readdir() - read from directory list
readdir_fopen() - readdir() and fopen()
 readdir_open() - readdir() and open()
 readdir_stat() - readdir() and stat()
    rewinddir() - reset directory list
        rmdir() - remove directory
        rstat() - stat() with directory size
      sortdir() - sort directory file list
   unlink_all() - remove all directory contents

The rstat() routines recursively calculate directory size. readdir_xxx() uses the DIR handle returned by opendir() to quickly complete the second function without any file name lookup. sortdir() reorders a directory's file list. unlink_all() is a fast way to empty a directory.


    fpathconf() - get configuration value
     pathconf() - get configuration value

FAT Label Access

 FatReadLabel() - Read FAT volume label
FatWriteLabel() - Write FAT volume label

These routines allow applications to read and write the volume label. The volume label is either the root directory label, if it exists, or the Volume Boot Record label.

File System API Document:
These and all the rest of the APIs are listed in this PDF file of the File System API.