From 4fd287655a72b9aea14cdac715ad5b90ed082ed2 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Sun, 19 Jun 2022 19:47:51 +0530 Subject: add circuitpython code --- circuitpython/shared/memzip/import.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 circuitpython/shared/memzip/import.c (limited to 'circuitpython/shared/memzip/import.c') diff --git a/circuitpython/shared/memzip/import.c b/circuitpython/shared/memzip/import.c new file mode 100644 index 0000000..2d5225b --- /dev/null +++ b/circuitpython/shared/memzip/import.c @@ -0,0 +1,17 @@ +#include + +#include "py/lexer.h" +#include "memzip.h" + +mp_import_stat_t mp_import_stat(const char *path) { + MEMZIP_FILE_INFO info; + + if (memzip_stat(path, &info) != MZ_OK) { + return MP_IMPORT_STAT_NO_EXIST; + } + + if (info.is_dir) { + return MP_IMPORT_STAT_DIR; + } + return MP_IMPORT_STAT_FILE; +} -- cgit v1.2.3