sd-reader
Functions
FAT access
FAT support

Basic functions for handling a FAT filesystem. More...

Functions

struct fat_fs_struct * fat_open (struct partition_struct *partition)
 Opens a FAT filesystem.
void fat_close (struct fat_fs_struct *fs)
 Closes a FAT filesystem.
offset_t fat_get_fs_size (const struct fat_fs_struct *fs)
 Returns the amount of total storage capacity of the filesystem in bytes.
offset_t fat_get_fs_free (const struct fat_fs_struct *fs)
 Returns the amount of free storage capacity on the filesystem in bytes.
uint8_t fat_get_fs_free_32_callback (uint8_t *buffer, offset_t offset, void *p)
 Callback function used for counting free clusters in a FAT32.

Detailed Description

Basic functions for handling a FAT filesystem.


Function Documentation

void fat_close ( struct fat_fs_struct *  fs)

Closes a FAT filesystem.

When this function returns, the given filesystem descriptor will be invalid.

Parameters:
[in]fsThe filesystem to close.
See also:
fat_open
offset_t fat_get_fs_free ( const struct fat_fs_struct *  fs)

Returns the amount of free storage capacity on the filesystem in bytes.

Note:
As the FAT filesystem is cluster based, this function does not return continuous values but multiples of the cluster size.
Parameters:
[in]fsThe filesystem on which to operate.
Returns:
0 on failure, the free filesystem space in bytes otherwise.
offset_t fat_get_fs_size ( const struct fat_fs_struct *  fs)

Returns the amount of total storage capacity of the filesystem in bytes.

Parameters:
[in]fsThe filesystem on which to operate.
Returns:
0 on failure, the filesystem size in bytes otherwise.
struct fat_fs_struct* fat_open ( struct partition_struct partition) [read]

Opens a FAT filesystem.

Parameters:
[in]partitionDiscriptor of partition on which the filesystem resides.
Returns:
0 on error, a FAT filesystem descriptor on success.
See also:
fat_close