diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2022-06-19 19:47:51 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2022-06-19 19:47:51 +0530 |
commit | 4fd287655a72b9aea14cdac715ad5b90ed082ed2 (patch) | |
tree | 65d393bc0e699dd12d05b29ba568e04cea666207 /circuitpython/shared/memzip/import.c | |
parent | 0150f70ce9c39e9e6dd878766c0620c85e47bed0 (diff) |
add circuitpython code
Diffstat (limited to 'circuitpython/shared/memzip/import.c')
-rw-r--r-- | circuitpython/shared/memzip/import.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 <stdio.h> + +#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; +} |