Sitelet https://github.com/micropython/micropython/issues/11449
Skip to content

os.sync not present on all platforms, how to be sure of filesystem consistency? #11449

Description

@massimosala

Current target: esp8266

On the official docs:
https://docs.micropython.org/en/latest/library/os.html

os.sync()
Sync all filesystems.

It seems to me that there are no references in the esp8266 pages regarding its absence:
https://docs.micropython.org/en/latest/esp8266/quickref.html

I have a long experience on linux and servers, so I know the possible pitfalls about syncing the file-systems and sudden power failures.

However... two questions:

  1. Why is os.sync not implemented on this target?
  2. Are there other solutions ?

As a workaround: after writing to the files, I call time.sleep(5) before reset().
It seems to work... but it's a bad trick, not reliable.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions