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

NameDescription
SYS_FS_InitializeInitializes the file system abstraction layer (sys_fs layer)
SYS_FS_TasksMaintains the File System tasks and functionalities
SYS_FS_MountMounts the disk/volume with specified file system
SYS_FS_UnmountUnmounts the disk/volume for the file system
SYS_FS_EventHandlerSetSets the pointer to the function (and it's context) to be called when mount/unmount event has occurred
SYS_FS_FileOpenOpens a file
SYS_FS_FileCloseCloses a file
SYS_FS_FileReadRead data from the file
SYS_FS_FileStatGets file status
SYS_FS_FileSeekMoves the file pointer by the requested offset
SYS_FS_FileTellObtains the file pointer position
SYS_FS_FileSizeReturns the size of the file in bytes
SYS_FS_FileEOFChecks for end of file
SYS_FS_FileNameGetReads the file name
SYS_FS_ErrorReturns the last error
SYS_FS_FileErrorReturns the file specific error
SYS_FS_FileStringGetReads a string from the file into a buffer
SYS_FS_FileStringPutWrites a string to a file
SYS_FS_FileWriteWrites data to the file
SYS_FS_FileSyncFlushes the cached information when writing to a file
SYS_FS_FileTruncateTruncates a file
SYS_FS_FileCharacterPutWrites a character to a file
SYS_FS_FilePrintfWrites a formatted string into a file
SYS_FS_FileTestErrorChecks for errors in the file
SYS_FS_DirOpenOpen a directory
SYS_FS_DirCloseCloses an opened directory
SYS_FS_DirReadReads the files and directories of the specified directory
SYS_FS_DirRewindRewinds to the beginning of the directory
SYS_FS_DirSearchSearches for a file or directory
SYS_FS_DirectoryMakeCreates a directory
SYS_FS_DirectoryChangeChanges to a the directory specified
SYS_FS_CurrentWorkingDirectoryGetGets the current working directory
SYS_FS_FileDirectoryRemoveRemoves a file or directory
SYS_FS_FileDirectoryRenameMoveRenames or moves a file or directory
SYS_FS_FileDirectoryModeSetSets the mode for the file or directory
SYS_FS_FileDirectoryTimeSetSets or changes the time for a file or directory
SYS_FS_CurrentDriveGetGets the current drive
SYS_FS_CurrentDriveSetSets the drive
SYS_FS_DriveLabelGetGets the drive label
SYS_FS_DriveLabelSetSets the drive label
SYS_FS_DriveFormatFormats a drive
SYS_FS_DrivePartitionPartitions a physical drive (media)
SYS_FS_DriveSectorGetObtains total number of sectors and number of free sectors for the specified drive

SYS FS Data types and constants

NameTypeDescription
SYS_FS_HANDLETypedefThis type defines the file handle
SYS_FS_HANDLE_INVALIDMacroInvalid file handle
SYS_FS_FILE_SYSTEM_TYPEEnumEnumerated data type identifying native file systems supported
SYS_FS_FILE_DIR_ATTREnumEnumerated data type identifying the various attributes for file/directory
SYS_FS_FILE_SEEK_CONTROLEnumLists the various modes of file seek
SYS_FS_RESULTEnumLists the various results of a file operation
SYS_FS_FORMATMacrosSpecifes the partitioning rule
SYS_FS_FORMAT_PARAMStructSYS FS Drive Format parameter structure
SYS_FS_FILE_OPEN_ATTRIBUTESEnumLists the various attributes (modes) in which a file can be opened
SYS_FS_ERROREnumLists the various error cases
SYS_FS_EVENTEnumIdentifies the possible file system events
SYS_FS_FUNCTIONSStructSYS FS Function signature structure for native file systems
SYS_FS_REGISTRATION_TABLEStructThe initialization members for File system layer
SYS_FS_FSTATStructFile System status
SYS_FS_TIMEUnionThe Union to specify the time for a file or directory
SYS_FS_EVENT_HANDLERTypedefPointer 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.

NameDescription
SYS_FS_MEDIA_MANAGER_AddressGetGets the starting media address based on a disk number
SYS_FS_MEDIA_MANAGER_CommandStatusGetGets the command status
SYS_FS_MEDIA_MANAGER_RegisterFunction to register media drivers with the media manager
SYS_FS_MEDIA_MANAGER_DeRegisterFunction to De-register media drivers with the media manager
SYS_FS_MEDIA_MANAGER_ReadGets data from a specific media address
SYS_FS_MEDIA_MANAGER_SectorReadReads a specified media sector
SYS_FS_MEDIA_MANAGER_SectorWriteWrites a sector to the specified media
SYS_FS_MEDIA_MANAGER_VolumePropertyGetGets the volume property
SYS_FS_MEDIA_MANAGER_MediaStatusGetGets the media status
SYS_FS_MEDIA_MANAGER_EventHandlerSetRegister the event handler for Mount/Un-Mount events
SYS_FS_MEDIA_MANAGER_RegisterTransferHandlerRegister the event handler for data transfer events
SYS_FS_MEDIA_MANAGER_GetMediaGeometryGets the media geometry information
SYS_FS_MEDIA_MANAGER_TransferTaskMedia manager transfer task function
SYS_FS_MEDIA_MANAGER_TasksMedia manager task function

SYS FS Media Manager Data types and constants

NameTypeDescription
SYS_FS_MEDIA_BLOCK_COMMAND_HANDLETypedefHandle identifying block commands of the media
SYS_FS_MEDIA_BLOCK_COMMAND_HANDLE_INVALIDMacroDefines the invalid media block command handle
SYS_FS_MEDIA_HANDLETypedefHandle identifying the media registered with the media manager
SYS_FS_MEDIA_HANDLE_INVALIDMacroDefines the invalid media handle
SYS_FS_MEDIA_BLOCK_EVENTEnumIdentifies the possible events that can result from a request
SYS_FS_MEDIA_PROPERTYEnumContains information of property of a media
SYS_FS_MEDIA_STATUSEnumThe status of media
SYS_FS_MEDIA_STATEEnumThe enumeration for state of media
SYS_FS_MEDIA_TYPEEnumThe enumeration for type of media
SYS_FS_MEDIA_COMMAND_STATUSEnumThe enumeration for status of buffer
SYS_FS_MEDIA_REGION_GEOMETRYTypedefContains information of a sys media region
SYS_FS_MEDIA_GEOMETRYTypedefContains all the geometrical information of a media device
SYS_FS_MEDIA_MOUNT_DATAStructStructure to obtain the device and mount name of media
SYS_FS_VOLUME_PROPERTYStructStructure to obtain the property of volume
SYS_FS_MEDIA_FUNCTIONSStructStructure of function pointers for media driver
SYS_FS_MEDIA_EVENT_HANDLERTypedefPointer to the Media Event Handler function