---
title: "MicroPython File‑System API: os, vfs and Abstract Block‑Device Explained"
url: "https://maker.wiznet.io/ruilixin6/projects/micropython-filesystem-api-os-vfs-and-abstract-blockdevice-explained/"
markdown_url: "https://maker.wiznet.io/ruilixin6/projects/micropython-filesystem-api-os-vfs-and-abstract-blockdevice-explained/md"
type: "UCC: User Created Content"
author: "FreakStudio"
author_url: "https://maker.wiznet.io/ruilixin6/"
original_author: "Freakstudio"
original_url: "https://f1829ryac0m.feishu.cn/drive/folder/Fh5Eftd3WlbEIIdHGdtcSsIgn7c?from=from_copyljjhg"
published: "2026-08-24"
language: "en"
tags: ["MicroPython", "Block-Device", "FileSystem", "os", "vfs"]
likes: 0
views: 107
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# MicroPython File‑System API: os, vfs and Abstract Block‑Device Explained

> Full analysis of MicroPython file‑system‑related software interfaces including os module, vfs virtual file‑system module and vfs.AbstractBlockDev abstract block

Original author: Freakstudio (source: https://f1829ryac0m.feishu.cn/drive/folder/Fh5Eftd3WlbEIIdHGdtcSsIgn7c?from=from_copyljjhg)

## Article

【Preliminary Note】The original hardware example in this article was written based on the RP2040. The actual hardware used in this hands-on demonstration features the W55RP20 as the main controller chip. The circuit logic and UF2 flashing operation principles are universally applicable, with only the main controller model differing. The original chip model mentioned in the circuit descriptions below is provided for reference purposes only.

![](https://maker.wiznet.io/upload/ckeditor5/383111824%5F1787588608%2Epng)

1. os module

The os module provides methods for file read‑write, directory creation and other operations:

![1.png](http://openwrite.cn/uploads/21597/64076/2a8b2682-44a1-4cc0-bee6-eb714f97e5b1.png) ![2.png](http://openwrite.cn/uploads/21597/64076/aa369b4c-5499-4cb1-b0b5-299d02fef87f.png)

1. vfs virtual‑file‑system module

The `vfs` (virtual file system) module contains functions for creating file‑system objects, mounting and unmounting file‑systems.

File‑system mount functions:

Available mountable file‑system classes:

![4.png](http://openwrite.cn/uploads/21597/64076/e74ce34f-016c-4932-b96b-1674951aa887.png)

1. Block‑device abstract class

`vfs.AbstractBlockDev` is the abstract base class for implementing block devices. Concrete block‑device classes must implement the methods listed below:

![5.png](http://openwrite.cn/uploads/21597/64076/2e87b2ad-f08a-4e7b-b11b-0e9d950636ef.png)

---

Source: https://maker.wiznet.io/ruilixin6/projects/micropython-filesystem-api-os-vfs-and-abstract-blockdevice-explained/
