Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly document/test file offset behavior in relation to FS file read/write APIs #1730

Closed
skliper opened this issue Jul 29, 2021 · 0 comments · Fixed by #1731 or #1759
Closed

Explicitly document/test file offset behavior in relation to FS file read/write APIs #1730

skliper opened this issue Jul 29, 2021 · 0 comments · Fixed by #1731 or #1759
Assignees
Labels
docs This change only affects documentation. enhancement unit-test
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Jul 29, 2021

Is your feature request related to a problem? Please describe.
It's not clear from the API where the file offset is left after using any of the FS APIs that access the file:
CFE_FS_ReadHeader
CFE_FS_WriteHeader
CFE_FS_SetTimestamp

Describe the solution you'd like
Right now, at least some apps in the wild depend on current behavior so preferred fix for Caelum is just to document current behavior (success and error). Error can be undefined, but success should be consistent/explicit.

Also worth adding a functional check to confirm this behavior (if it's not already checked).

Describe alternatives you've considered
Could explicitly be undefined, or change behavior to reset to the start of the file but that would ripple through all the apps.

Additional context
From an app code review, currently undocumented behavior means apps should all lseek but rather than change every app it's likely better to document the current behavior explicitly in the API.

Requester Info
Jacob Hageman - NASA/GSFC, ping @ejtimmon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change only affects documentation. enhancement unit-test
Projects
None yet
2 participants