SdFat: SdFile Class Reference

SdFat

Public Member Functions | Static Public Member Functions | List of all members
SdFile Class Reference

FAT16/FAT32 file with Print. More...

`#include <SdFat.h>`

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

## Public Member Functions
| SdFile (const char *path, oflag_t oflag)
size_t | write (uint8_t b)

## Static Public Member Functions
static void | dateTimeCallback (void(*dateTime)(uint16_t *date, uint16_t *time))
static void | dateTimeCallbackCancel ()

## Detailed Description

FAT16/FAT32 file with Print.

## Constructor & Destructor Documentation

## ◆ SdFile()

SdFile::SdFile | ( | const char * | path,
|  | oflag_t | oflag
| ) |  |
| inline

Create an open SdFile.

Parameters

  [in] | path | path for file.
  [in] | oflag | open flags.

## Member Function Documentation

## ◆ dateTimeCallback()

static void SdFile::dateTimeCallback | ( | void(*)(uint16_t *date, uint16_t *time) | dateTime | ) |
| inlinestatic

Set the date/time callback function

Parameters

  [in] | dateTime | The user's call back function. The callback function is of the form:

void dateTime(uint16_t* date, uint16_t* time) {
uint16_t year;
uint8_t month, day, hour, minute, second;
// User gets date and time from GPS or real-time clock here
// return date using FS_DATE macro to format fields
*date = FS_DATE(year, month, day);
// return time using FS_TIME macro to format fields
*time = FS_TIME(hour, minute, second);
}

Sets the function that is called when a file is created or when a file's directory entry is modified by sync(). All timestamps, access, creation, and modify, are set when a file is created. sync() maintains the last access date and last modify date/time.

## ◆ dateTimeCallbackCancel()

static void SdFile::dateTimeCallbackCancel | ( |  | ) |
| inlinestatic

Cancel the date/time callback function.

## ◆ write()

size_t PrintFile< SdBaseFile >::write | ( | uint8_t | b | ) |
| inlineinherited

Write a single byte.

Parameters

  [in] | b | byte to write.

Returns
  one for success.

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

- ArduinoSdFat/libraries/SdFat/src/SdFat.h