From e22db4ab5a50ffc38c2f05e8acf83f819d6cc2f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E6=B5=A9?= Date: Fri, 19 May 2023 14:07:23 +0800 Subject: [PATCH] Clean sdcard test txt files to free card spaces. --- micropython/drivers/storage/sdcard/sdtest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micropython/drivers/storage/sdcard/sdtest.py b/micropython/drivers/storage/sdcard/sdtest.py index 018ef7c6..bd4520ba 100644 --- a/micropython/drivers/storage/sdcard/sdtest.py +++ b/micropython/drivers/storage/sdcard/sdtest.py @@ -26,10 +26,10 @@ def sdtest(): print(n, "bytes written") n = f.write(lines) print(n, "bytes written") - with open(fn, "r") as f: result1 = f.read() print(len(result1), "bytes read") + os.remove(fn) fn = "/fc/rats1.txt" print() @@ -37,10 +37,10 @@ def sdtest(): with open(fn, "w") as f: n = f.write(short) # one block print(n, "bytes written") - with open(fn, "r") as f: result2 = f.read() print(len(result2), "bytes read") + os.remove(fn) os.umount("/fc")