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

Implement ftruncate function (IDFGH-6641) #8279

Closed
igrr opened this issue Jan 24, 2022 · 2 comments
Closed

Implement ftruncate function (IDFGH-6641) #8279

igrr opened this issue Jan 24, 2022 · 2 comments
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@igrr
Copy link
Member

igrr commented Jan 24, 2022

Is your feature request related to a problem? Please describe.

truncate function was requested in #1980 and implemented in c77f84e, however the related ftruncate function was not implemented.

Describe the solution you'd like

  • Implement ftruncate function in VFS
  • Implement ftruncate in FAT VFS

Describe alternatives you've considered

Instead of having both truncate and ftruncate functions in VFS interface, VFS layer could supply a truncate implementation and only require ftruncate to be implemented by the VFS driver. The VFS layer could implement truncate using driver's open, ftruncate, close methods. This, however, would be a breaking change since we would have to replace truncate with ftruncate in the VFS interface.

Additional context

Requested in a comment to the closed issue: #1980 (comment)
Issues that would be solved by implementing this:

@igrr igrr added the Type: Feature Request Feature request for IDF label Jan 24, 2022
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 24, 2022
@github-actions github-actions bot changed the title Implement ftruncate function Implement ftruncate function (IDFGH-6641) Jan 24, 2022
@Rajssss
Copy link

Rajssss commented Feb 16, 2022

@igrr any update on this?

@MabezDev
Copy link
Collaborator

MabezDev commented Mar 3, 2022

FYI the Rust standard library relies on ftruncate being available, first reported here: esp-rs/rust#100.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Mar 7, 2022
espressif-bot pushed a commit that referenced this issue May 11, 2022
Unit test cases added to verify ftruncate within fatfs tests.

Closes #8279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

4 participants