SdFat: ExFatVolume Class Reference

SdFat

Public Member Functions | List of all members
ExFatVolume Class Reference

exFAT volume. More...

`#include <ExFatVolume.h>`

Inheritance diagram for ExFatVolume:
[legend]
Collaboration diagram for ExFatVolume:
[legend]

## Public Member Functions
bool | begin (BlockDevice *dev, bool setCwv=true, uint8_t part=1)
uint32_t | bytesPerCluster () const
uint8_t | bytesPerClusterShift () const
uint16_t | bytesPerSector () const
uint8_t | bytesPerSectorShift () const
uint8_t * | cacheClear ()
bool | chdir ()
bool | chdir (const char *path)
void | chvol ()
uint32_t | clusterCount () const
uint32_t | clusterHeapStartSector () const
bool | exists (const char *path)
uint32_t | fatLength () const
uint32_t | fatStartSector () const
uint8_t | fatType () const
uint32_t | freeClusterCount ()
bool | init (BlockDevice *dev, uint8_t part)
bool | isBusy ()
bool | ls (print_t *pr, const char *path, uint8_t flags)
bool | ls (print_t *pr, uint8_t flags=0)
bool | mkdir (const char *path, bool pFlag=true)
ExFile | open (const char *path, oflag_t oflag=0X00)
bool | remove (const char *path)
bool | rename (const char *oldPath, const char *newPath)
bool | rmdir (const char *path)
uint32_t | rootDirectoryCluster () const
uint32_t | rootLength ()
uint32_t | sectorsPerCluster () const
uint8_t | sectorsPerClusterShift () const
bool | truncate (const char *path, uint64_t length)

## Detailed Description

exFAT volume.

Copyright (c) 2011-2020 Bill Greiman This file is part of the SdFat library for SD memory cards.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Member Function Documentation

## ◆ begin()

bool ExFatVolume::begin | ( | BlockDevice * | dev,
|  | bool | setCwv = `true`,
|  | uint8_t | part = `1`
| ) |  |
| inline

Initialize an FatVolume object.

Parameters

  [in] | dev | Device block driver.
  [in] | setCwv | Set current working volume if true.
  [in] | part | partition to initialize.

Returns
  true for success or false for failure.

## ◆ bytesPerCluster()

uint32_t ExFatPartition::bytesPerCluster | ( |  | ) | const
| inlineinherited

Returns
  the number of bytes in a cluster.

## ◆ bytesPerClusterShift()

uint8_t ExFatPartition::bytesPerClusterShift | ( |  | ) | const
| inlineinherited

Returns
  the power of two for bytesPerCluster.

## ◆ bytesPerSector()

uint16_t ExFatPartition::bytesPerSector | ( |  | ) | const
| inlineinherited

Returns
  the number of bytes in a sector.

## ◆ bytesPerSectorShift()

uint8_t ExFatPartition::bytesPerSectorShift | ( |  | ) | const
| inlineinherited

Returns
  the power of two for bytesPerSector.

## ◆ cacheClear()

uint8_t* ExFatPartition::cacheClear | ( |  | ) |
| inlineinherited

Clear the cache and returns a pointer to the cache. Not for normal apps.

Returns
  A pointer to the cache buffer or zero if an error occurs.

## ◆ chdir() [1/2]

bool ExFatVolume::chdir | ( |  | ) |
| inline

Set volume working directory to root.

Returns
  true for success or false for failure.

## ◆ chdir() [2/2]

bool ExFatVolume::chdir | ( | const char * | path | ) |

Set volume working directory.

Parameters

  [in] | path | Path for volume working directory.

Returns
  true for success or false for failure.

## ◆ chvol()

void ExFatVolume::chvol | ( |  | ) |
| inline

Change global working volume to this volume.

## ◆ clusterCount()

uint32_t ExFatPartition::clusterCount | ( |  | ) | const
| inlineinherited

Returns
  the cluster count for the partition.

## ◆ clusterHeapStartSector()

uint32_t ExFatPartition::clusterHeapStartSector | ( |  | ) | const
| inlineinherited

Returns
  the cluster heap start sector.

## ◆ exists()

bool ExFatVolume::exists | ( | const char * | path | ) |
| inline

Test for the existence of a file.

Parameters

  [in] | path | Path of the file to be tested for.

Returns
  true if the file exists else false.

## ◆ fatLength()

uint32_t ExFatPartition::fatLength | ( |  | ) | const
| inlineinherited

Returns
  the FAT length in sectors

## ◆ fatStartSector()

uint32_t ExFatPartition::fatStartSector | ( |  | ) | const
| inlineinherited

Returns
  the FAT start sector number.

## ◆ fatType()

uint8_t ExFatPartition::fatType | ( |  | ) | const
| inlineinherited

Returns
  Type FAT_TYPE_EXFAT for exFAT partition or zero for error.

## ◆ freeClusterCount()

uint32_t ExFatPartition::freeClusterCount | ( |  | ) |
| inherited

Returns
  the free cluster count.

## ◆ init()

bool ExFatPartition::init | ( | BlockDevice * | dev,
|  | uint8_t | part
| ) |  |
| inherited

Initialize a exFAT partition.

Parameters

  [in] | dev | The blockDevice for the partition.
  [in] | part | The partition to be used. Legal values for part are 1-4 to use the corresponding partition on a device formatted with a MBR, Master Boot Record, or zero if the device is formatted as a super floppy with the FAT boot sector in sector zero.

Returns
  true for success or false for failure.

## ◆ isBusy()

bool ExFatPartition::isBusy | ( |  | ) |
| inlineinherited

Check for BlockDevice busy.

Returns
  true if busy else false.

## ◆ ls() [1/2]

bool ExFatVolume::ls | ( | print_t * | pr,
|  | const char * | path,
|  | uint8_t | flags
| ) |  |
| inline

List the contents of a directory.

Parameters

  [in] | pr | Print stream for list.
  [in] | path | directory to list.
  [in] | flags | The inclusive OR of

LS_DATE - Print file modification date

LS_SIZE - Print file size.

LS_R - Recursive list of subdirectories.

Returns
  true for success or false for failure.

## ◆ ls() [2/2]

bool ExFatVolume::ls | ( | print_t * | pr,
|  | uint8_t | flags = `0`
| ) |  |
| inline

List the directory contents of the root directory.

Parameters

  [in] | pr | Print stream for list.
  [in] | flags | The inclusive OR of

LS_DATE - Print file modification date

LS_SIZE - Print file size.

LS_R - Recursive list of subdirectories.

Returns
  true for success or false for failure.

## ◆ mkdir()

bool ExFatVolume::mkdir | ( | const char * | path,
|  | bool | pFlag = `true`
| ) |  |
| inline

Make a subdirectory in the volume root directory.

Parameters

  [in] | path | A path with a valid 8.3 DOS name for the subdirectory.
  [in] | pFlag | Create missing parent directories if true.

Returns
  true for success or false for failure.

## ◆ open()

ExFile ExFatVolume::open | ( | const char * | path,
|  | oflag_t | oflag = `0X00`
| ) |  |
| inline

open a file

Parameters

  [in] | path | location of file to be opened.
  [in] | oflag | open flags.

Returns
  a ExFile object.

## ◆ remove()

bool ExFatVolume::remove | ( | const char * | path | ) |
| inline

Remove a file from the volume root directory.

Parameters

  [in] | path | A path with a valid 8.3 DOS name for the file.

Returns
  true for success or false for failure.

## ◆ rename()

bool ExFatVolume::rename | ( | const char * | oldPath,
|  | const char * | newPath
| ) |  |
| inline

Rename a file or subdirectory.

Parameters

  [in] | oldPath | Path name to the file or subdirectory to be renamed.
  [in] | newPath | New path name of the file or subdirectory.

The newPath object must not exist before the rename call.

The file to be renamed must not be open. The directory entry may be moved and file system corruption could occur if the file is accessed by a file object that was opened before the rename() call.

Returns
  true for success or false for failure.

## ◆ rmdir()

bool ExFatVolume::rmdir | ( | const char * | path | ) |
| inline

Remove a subdirectory from the volume's working directory.

Parameters

  [in] | path | A path with a valid 8.3 DOS name for the subdirectory.

The subdirectory file will be removed only if it is empty.

Returns
  true for success or false for failure.

## ◆ rootDirectoryCluster()

uint32_t ExFatPartition::rootDirectoryCluster | ( |  | ) | const
| inlineinherited

Returns
  the root directory start cluster number.

## ◆ rootLength()

uint32_t ExFatPartition::rootLength | ( |  | ) |
| inherited

Returns
  the root directory length.

## ◆ sectorsPerCluster()

uint32_t ExFatPartition::sectorsPerCluster | ( |  | ) | const
| inlineinherited

Returns
  the number of sectors in a cluster.

## ◆ sectorsPerClusterShift()

uint8_t ExFatPartition::sectorsPerClusterShift | ( |  | ) | const
| inlineinherited

Returns
  the power of two for sectors per cluster.

## ◆ truncate()

bool ExFatVolume::truncate | ( | const char * | path,
|  | uint64_t | length
| ) |  |
| inline

Truncate a file to a specified length. The current file position will be at the new EOF.

Parameters

  [in] | path | A path with a valid 8.3 DOS name for the file.
  [in] | length | The desired length for the file.

Returns
  true for success or false for failure.

The documentation for this class was generated from the following files:

- ArduinoSdFat/libraries/SdFat/src/ExFatLib/ExFatVolume.h
- ArduinoSdFat/libraries/SdFat/src/ExFatLib/ExFatVolume.cpp