Jump to main content

##

# 1.2.7.4 Library Interface

File System Service library provides the following interfaces:

SYS FS Functions

These API's should be used from application layer to perform any file operation

Name | Description
--- | ---
SYS_FS_Initialize | Initializes the file system abstraction layer (sys_fs layer)
SYS_FS_Tasks | Maintains the File System tasks and functionalities
SYS_FS_Mount | Mounts the disk/volume with specified file system
SYS_FS_Unmount | Unmounts the disk/volume for the file system
SYS_FS_EventHandlerSet | Sets the pointer to the function (and it's context) to be called when mount/unmount event has occurred
SYS_FS_FileOpen | Opens a file
SYS_FS_FileClose | Closes a file
SYS_FS_FileRead | Read data from the file
SYS_FS_FileStat | Gets file status
SYS_FS_FileSeek | Moves the file pointer by the requested offset
SYS_FS_FileTell | Obtains the file pointer position
SYS_FS_FileSize | Returns the size of the file in bytes
SYS_FS_FileEOF | Checks for end of file
SYS_FS_FileNameGet | Reads the file name
SYS_FS_Error | Returns the last error
SYS_FS_FileError | Returns the file specific error
SYS_FS_FileStringGet | Reads a string from the file into a buffer
SYS_FS_FileStringPut | Writes a string to a file
SYS_FS_FileWrite | Writes data to the file
SYS_FS_FileSync | Flushes the cached information when writing to a file
SYS_FS_FileTruncate | Truncates a file
SYS_FS_FileCharacterPut | Writes a character to a file
SYS_FS_FilePrintf | Writes a formatted string into a file
SYS_FS_FileTestError | Checks for errors in the file
SYS_FS_DirOpen | Open a directory
SYS_FS_DirClose | Closes an opened directory
SYS_FS_DirRead | Reads the files and directories of the specified directory
SYS_FS_DirRewind | Rewinds to the beginning of the directory
SYS_FS_DirSearch | Searches for a file or directory
SYS_FS_DirectoryMake | Creates a directory
SYS_FS_DirectoryChange | Changes to a the directory specified
SYS_FS_CurrentWorkingDirectoryGet | Gets the current working directory
SYS_FS_FileDirectoryRemove | Removes a file or directory
SYS_FS_FileDirectoryRenameMove | Renames or moves a file or directory
SYS_FS_FileDirectoryModeSet | Sets the mode for the file or directory
SYS_FS_FileDirectoryTimeSet | Sets or changes the time for a file or directory
SYS_FS_CurrentDriveGet | Gets the current drive
SYS_FS_CurrentDriveSet | Sets the drive
SYS_FS_DriveLabelGet | Gets the drive label
SYS_FS_DriveLabelSet | Sets the drive label
SYS_FS_DriveFormat | Formats a drive
SYS_FS_DrivePartition | Partitions a physical drive (media)
SYS_FS_DriveSectorGet | Obtains total number of sectors and number of free sectors for the specified drive

SYS FS Data types and constants

Name | Type | Description
--- | --- | ---
SYS_FS_HANDLE | Typedef | This type defines the file handle
SYS_FS_HANDLE_INVALID | Macro | Invalid file handle
SYS_FS_FILE_SYSTEM_TYPE | Enum | Enumerated data type identifying native file systems supported
SYS_FS_FILE_DIR_ATTR | Enum | Enumerated data type identifying the various attributes for file/directory
SYS_FS_FILE_SEEK_CONTROL | Enum | Lists the various modes of file seek
SYS_FS_RESULT | Enum | Lists the various results of a file operation
SYS_FS_FORMAT | Macros | Specifes the partitioning rule
SYS_FS_FORMAT_PARAM | Struct | SYS FS Drive Format parameter structure
SYS_FS_FILE_OPEN_ATTRIBUTES | Enum | Lists the various attributes (modes) in which a file can be opened
SYS_FS_ERROR | Enum | Lists the various error cases
SYS_FS_EVENT | Enum | Identifies the possible file system events
SYS_FS_FUNCTIONS | Struct | SYS FS Function signature structure for native file systems
SYS_FS_REGISTRATION_TABLE | Struct | The initialization members for File system layer
SYS_FS_FSTAT | Struct | File System status
SYS_FS_TIME | Union | The Union to specify the time for a file or directory
SYS_FS_EVENT_HANDLER | Typedef | Pointer to the File system Handler function

SYS FS Media Manager Functions

These API's should not be direclty used from application layer. These can be used internally by media drivers and other clients within Harmony framework if needed.

Name | Description
--- | ---
SYS_FS_MEDIA_MANAGER_AddressGet | Gets the starting media address based on a disk number
SYS_FS_MEDIA_MANAGER_CommandStatusGet | Gets the command status
SYS_FS_MEDIA_MANAGER_Register | Function to register media drivers with the media manager
SYS_FS_MEDIA_MANAGER_DeRegister | Function to De-register media drivers with the media manager
SYS_FS_MEDIA_MANAGER_Read | Gets data from a specific media address
SYS_FS_MEDIA_MANAGER_SectorRead | Reads a specified media sector
SYS_FS_MEDIA_MANAGER_SectorWrite | Writes a sector to the specified media
SYS_FS_MEDIA_MANAGER_VolumePropertyGet | Gets the volume property
SYS_FS_MEDIA_MANAGER_MediaStatusGet | Gets the media status
SYS_FS_MEDIA_MANAGER_EventHandlerSet | Register the event handler for Mount/Un-Mount events
SYS_FS_MEDIA_MANAGER_RegisterTransferHandler | Register the event handler for data transfer events
SYS_FS_MEDIA_MANAGER_GetMediaGeometry | Gets the media geometry information
SYS_FS_MEDIA_MANAGER_TransferTask | Media manager transfer task function
SYS_FS_MEDIA_MANAGER_Tasks | Media manager task function

SYS FS Media Manager Data types and constants

Name | Type | Description
--- | --- | ---
SYS_FS_MEDIA_BLOCK_COMMAND_HANDLE | Typedef | Handle identifying block commands of the media
SYS_FS_MEDIA_BLOCK_COMMAND_HANDLE_INVALID | Macro | Defines the invalid media block command handle
SYS_FS_MEDIA_HANDLE | Typedef | Handle identifying the media registered with the media manager
SYS_FS_MEDIA_HANDLE_INVALID | Macro | Defines the invalid media handle
SYS_FS_MEDIA_BLOCK_EVENT | Enum | Identifies the possible events that can result from a request
SYS_FS_MEDIA_PROPERTY | Enum | Contains information of property of a media
SYS_FS_MEDIA_STATUS | Enum | The status of media
SYS_FS_MEDIA_STATE | Enum | The enumeration for state of media
SYS_FS_MEDIA_TYPE | Enum | The enumeration for type of media
SYS_FS_MEDIA_COMMAND_STATUS | Enum | The enumeration for status of buffer
SYS_FS_MEDIA_REGION_GEOMETRY | Typedef | Contains information of a sys media region
SYS_FS_MEDIA_GEOMETRY | Typedef | Contains all the geometrical information of a media device
SYS_FS_MEDIA_MOUNT_DATA | Struct | Structure to obtain the device and mount name of media
SYS_FS_VOLUME_PROPERTY | Struct | Structure to obtain the property of volume
SYS_FS_MEDIA_FUNCTIONS | Struct | Structure of function pointers for media driver
SYS_FS_MEDIA_EVENT_HANDLER | Typedef | Pointer to the Media Event Handler function