Getting started with FileX

APIs FileX Description

The FileX file system provides a range of services organized into distinct functional domains, including:

  • File services

  • Directory services

  • Media services

  • System services

  • Utility services

  • Journal services

  • Configuration and query services

  • Protection services

The following tables describe, for each domain, the various FileX services and their primary purpose.

Directory Services

FileX APIs Functions

Documentation

fx_directory_attributes_read

documentation:fx_directory_attributes_read

fx_directory_create

documentation:fx_directory_create

fx_directory_default_get

documentation:fx_directory_default_get

fx_directory_default_set

documentation:fx_directory_default_set

fx_directory_delete

documentation:fx_directory_delete

fx_directory_first_entry_find

documentation:fx_directory_first_entry_find

fx_directory_information_get

documentation:fx_directory_information_get

fx_directory_local_path_clear

documentation:fx_directory_local_path_clear

fx_directory_local_path_get

documentation:fx_directory_local_path_get

fx_directory_local_path_restore

documentation:fx_directory_local_path_restore

fx_directory_local_path_set

documentation:fx_directory_local_path_set

fx_directory_long_name_get

documentation:fx_directory_long_name_get

fx_directory_name_test

documentation:fx_directory_name_test

fx_directory_next_entry_find

documentation:fx_directory_next_entry_find

fx_directory_next_full_entry_find

documentation:fx_directory_next_full_entry_find

fx_directory_rename

documentation:fx_directory_rename

fx_directory_short_name_get

documentation:fx_directory_short_name_get

fx_directory_short_name_get_extended

documentation:fx_directory_short_name_get_extended

File Services

FileX APIs Functions

Documentation

fx_file_allocate

documentation:fx_file_allocate

fx_file_attributes_read

documentation:fx_file_attributes_read

fx_file_attributes_set

documentation:fx_file_attributes_set

fx_file_best_effort_allocate

documentation:fx_file_best_effort_allocate

fx_file_close

documentation:fx_file_close

fx_file_create

documentation:fx_file_create

fx_file_date_time_set

documentation:fx_file_date_time_set

fx_file_delete

documentation:fx_file_delete

fx_file_extended_allocate

documentation:fx_file_extended_allocate

fx_file_extended_best_effort_allocate

documentation:fx_file_extended_best_effort_allocate

fx_file_extended_relative_seek

documentation:fx_file_extended_relative_seek

fx_file_extended_seek

documentation:fx_file_extended_seek

fx_file_extended_truncate

documentation:fx_file_extended_truncate

fx_file_extended_truncate_release

documentation:fx_file_extended_truncate_release

fx_file_open

documentation:fx_file_open

fx_file_read

documentation:fx_file_read

fx_file_relative_seek

documentation:fx_file_relative_seek

fx_file_rename

documentation:fx_file_rename

fx_file_seek

documentation:fx_file_seek

fx_file_truncate

documentation:fx_file_truncate

fx_file_truncate_release

documentation:fx_file_truncate_release

fx_file_write

documentation:fx_file_write

fx_file_write_notify_set

documentation:fx_file_write_notify_set

Media Services

FileX APIs Functions

Documentation

fx_fault_tolerant_enable

documentation:fx_fault_tolerant_enable

fx_media_abort

documentation:fx_media_abort

fx_media_cache_invalidate

documentation:fx_media_cache_invalidate

fx_media_check

documentation:fx_media_check

fx_media_close

documentation:fx_media_close

fx_media_close_notify_set

documentation:fx_media_close_notify_set

fx_media_extended_space_available

documentation:fx_media_extended_space_available

fx_media_flush

documentation:fx_media_flush

fx_media_format

documentation:fx_media_format

fx_media_open

documentation:fx_media_open

fx_media_open_notify_set

documentation:fx_media_open_notify_set

fx_media_read

documentation:fx_media_read

fx_media_space_available

documentation:fx_media_space_available

fx_media_volume_get

documentation:fx_media_volume_get

fx_media_write

documentation:fx_media_write

System Services

FileX APIs Functions

Documentation

fx_system_date_get

documentation:fx_system_date_get

fx_system_date_set

documentation:fx_system_date_set

fx_system_initialize

documentation:fx_system_initialize

fx_system_time_get

documentation:fx_system_time_get

fx_system_time_set

documentation:fx_system_time_set

Unicode Services

FileX APIs Functions

Documentation

fx_unicode_directory_create

documentation:fx_unicode_directory_create

fx_unicode_directory_rename

documentation:fx_unicode_directory_rename

fx_unicode_file_create

documentation:fx_unicode_file_create

fx_unicode_file_rename

documentation:fx_unicode_file_rename

fx_unicode_length_get

documentation:fx_unicode_length_get

fx_unicode_length_get_extended

documentation:fx_unicode_length_get_extended

fx_unicode_name_get

documentation:fx_unicode_name_get

fx_unicode_short_name_get

documentation:fx_unicode_short_name_get

fx_unicode_short_name_get_extended

documentation:fx_unicode_short_name_get_extended

Configuration flags

FileX is modular and configurable. It provides a set of configuration options that you can tune depending on application needs.

To configure these flags, you must:

  • Provide a file named fx_user.h at the application level that contains the configuration flags.

  • Pass the preprocessor definition FX_INCLUDE_USER_DEFINE_FILE at compile time.

Otherwise, all flags use default values defined in the fx_port.h file.

FileX Config configuration_file

FileX configuration file usage

The configuration flags are split into three categories:

  • Core flags: these flags apply to the FileX core.

  • Fault Tolerance flags: these flags relate to the fail-safe feature in FileX.

  • Misc flags: these flags control features such as statistics and error checking.

Below is the list of the configuration flags:

FileX configuration flags

Flag

Description

Type

Min

Default

Max

FX_DISABLE_DIRECT_DATA_READ _CACHE_FILL

Disable the direct read sector update of cache

Boolean

Disabled

Disabled

Enabled

FX_DISABLE_ERROR_CHECKING

Remove the basic FileX error checking API

Boolean

Disabled

Disabled

Enabled

FX_DONT_UPDATE_OPEN_FILES

Do not update already opened files

Boolean

Disabled

Disabled

Enabled

FX_DRIVER_USE_64BIT_LBA

Enable 64-bit sector addresses used in the I/O driver

Boolean

Disabled

Disabled

Enabled

FX_ENABLE_FAULT_TOLERANT

Enable FileX fault tolerant service

Boolean

Disabled

Disabled

Enabled

FX_FAT_MAP_SIZE

Specifies the number of sectors that can be represented in the FAT update map

Integer

1

128

32*1024

FX_FAULT_TOLERANT

When defined, system sector write requests are flushed immediately to the driver

Boolean

Disabled

Disabled

Enabled

FX_FAULT_TOLERANT_DATA

When defined, data sector write requests are flushed immediately to the driver

Boolean

Disabled

Disabled

Enabled

FX_MAX_FAT_CACHE

Define the number of entries in the FAT cache

Integer

16

16

16*1024

FX_MAX_LAST_NAME_LEN

Define the maximum file name length

Integer

13

256

256

FX_MAX_LONG_NAME_LEN

Define the maximum size of long file names supported by FileX

Integer

13

256

256

FX_MAX_SECTOR_CACHE

Define the maximum number of logical sectors that can be cached by FileX

Integer

2

256

16*1024

FX_SINGLE_OPEN_LEGACY

When defined, legacy single open logic for the same file is enabled

Boolean

Disabled

Disabled

Enabled

FX_UPDATE_RATE_IN_SECONDS

Defines the number of seconds the time parameters are updated in FileX

Integer

10

10

60

FX_UPDATE_RATE_IN_TICKS

Defines the number of RTOS ticks required to achieve the update rate

Integer

10000

10000

60000

FX_DISABLE_CACHE

Determine if cache is disabled

Boolean

Disabled

Disabled

Enabled

FX_DISABLE_FILE_CLOSE

When defined, file close is disabled

Boolean

Disabled

Disabled

Enabled

FX_RENAME_PATH_INHERIT

When enabled, renaming inherits path information

Boolean

Disabled

Disabled

Enabled

FX_NO_LOCAL_PATH

When defined, the local path support is disabled

Boolean

Disabled

Disabled

Enabled

FX_DISABLE_FAST_OPEN

When defined, fast open is disabled

Boolean

Disabled

Disabled

Enabled

FX_DISABLE_FORCE_MEMORY -OPERATION

When defined, force memory operations are disabled

Boolean

Disabled

Disabled

Enabled

FX_DISABLE_BUILD_OPTIONS

When defined, build options are disabled

Boolean

Disabled

Disabled

Enabled

FX_DISABLE_ONE_LINE_FUNCTION

When defined, one line function support is disabled

Boolean

Disabled

Disabled

Enabled

FX_DISABLE_FAT_ENTRY_REFRESH

When defined, FAT entry refresh is disabled

Boolean

Disabled

Disabled

Enabled

FX_DISABLE_CONSECUTIVE _DETECT

When defined, consecutive sectors detection is disabled

Boolean

Disabled

Disabled

Enabled

FX_STANDALONE_ENABLE

Configure FileX in bare-metal mode

Boolean

Disabled

Disabled

Enabled

FX_SINGLE_THREAD

Eliminates RTOS protection logic from the FileX source

Boolean

Disabled

Disabled

Enabled

FX_MEDIA_STATISTICS_DISABLE

When defined, gathering of media statistics is disabled

Boolean

Disabled

Disabled

Enabled

FX_MEDIA_DISABLE_SEARCH_CACHE

When defined, the file search cache optimization is disabled

Boolean

Disabled

Disabled

Enabled

FX_NO_TIMER

When defined, FileX is built without update to the time parameters

Boolean

Disabled

Disabled

Enabled