whiskers 0.2.0
RP2350 BadUSB Tool
Loading...
Searching...
No Matches
hal_file Struct Reference

File struct to be used in file operations. More...

#include <shared.h>

Data Fields

char * filename
size_t fsize
uint8_t fattrs
uint16_t fdate
uint16_t ftime
void * _internal_fp
bool _internal_has_file
HAL_ERROR errno

Detailed Description

File struct to be used in file operations.

See also
hal_dir

This file struct is used primarily for 3 things:

  • To internally hold the implementation specific pointer to the file object. You should NEVER directly modify this, that is the HAL's responsibility.
  • To hold file information returned by ffstat or the functions mentioned below.
  • To hold a returned errno by some functions that do not need file information (mainly ffunlink).

Anything that has the prefix _internal should NEVER be modified in user code!

All the file information fields (ie. the name, size, etc.) are only filled out by ffstat and ffreadir. ffopen does NOT do this!

Field Documentation

◆ _internal_fp

void* hal_file::_internal_fp

Internal file pointer. DO NOT TOUCH THIS!

◆ _internal_has_file

bool hal_file::_internal_has_file

Internal to check whether or not a file is opened in this struct. This can be reference to see if this file struct needs to be closed or can open a file

◆ errno

HAL_ERROR hal_file::errno

Error number returned by the f* functions. This is only set if an actual error occured. See shared.h on how to convert these into strings.

◆ fattrs

uint8_t hal_file::fattrs

Access modifiers. You can typically ignore these as they're FatFS specific and have no real purpose in this project.

◆ fdate

uint16_t hal_file::fdate

Date file was last modified.

◆ filename

char* hal_file::filename

The filename returned by either ffstat or the directory functions that return file info. This is allocated internally and will be changed with some functions calls. This is noted in the documentation of those functions.

◆ fsize

size_t hal_file::fsize

Size of the file.

◆ ftime

uint16_t hal_file::ftime

Time file was last modified.


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