Skip to content

Add file truncate() #11402

Open
Open

Description

@CTho9305

We don't have .truncate() and extending FAT files can be slow (and blocking), so high-frequency loggers need to preallocate oversized files, then later truncate them. This currently requires copying upon completion (slow + requires extra free space). Basically the same request as this upstream one:
micropython#4775

That one has a PR on it already, which looks pretty much how I'd expect: micropython#11500

Can we just grab that PR (or evangelize for MP to accept it or specify what exactly needs to change to get it accepted)?

Activity

  1. added this to the Long term milestone on Sep 17, 2026
  2. tannewt commented on Sep 17, 2026

    @tannewt
    Member

    Can we just grab that PR (or evangelize for MP to accept it or specify what exactly needs to change to get it accepted)?

    It is fine to grab commits off of pending PRs, rebase them onto circuitpython/main and then make a PR to main. No need to wait on MicroPython.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions