diff options
author | Dave Hylands <dhylands@gmail.com> | 2015-10-31 21:24:47 -0700 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-11-04 14:21:10 +0000 |
commit | 074d713bfb845a87e557e608f5215f53694e7d01 (patch) | |
tree | 3688db7f8d476613bc0888b4be6a01a5238b63af /lib/memzip/import.c | |
parent | a9f3030371094e3308b4d2150853db2ee3aa4a6b (diff) | |
download | micropython-074d713bfb845a87e557e608f5215f53694e7d01.tar.gz micropython-074d713bfb845a87e557e608f5215f53694e7d01.zip |
lib/memzip: Factor out memzip from teensy/ into lib/memzip.
Diffstat (limited to 'lib/memzip/import.c')
-rw-r--r-- | lib/memzip/import.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/memzip/import.c b/lib/memzip/import.c new file mode 100644 index 0000000000..2d5225b888 --- /dev/null +++ b/lib/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; +} |