| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
| |
With this patch the n_args parameter is changed type from mp_uint_t to
size_t.
|
|
|
|
|
| |
That's just function which sets/gets dup terminal object, and can be
easily reused across ports.
|
| |
|
| |
|
| |
|
|
|
|
| |
Ports will need to #define _DIRENT_HAVE_D_INO (0) to disable d_ino use.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
ilistdir() returns iterator which yields triples of (name, type, ino)
where ino is inode number for entry's data, type of entry (file/dir/etc.),
and name of file/dir. listdir() can be easily implemented in terms of this
iterator (which is otherwise more efficient in terms of memory use and may
save expensive call to stat() for each returned entry).
CPython has os.scandir() which also returns an iterator, but it yields
more complex objects of DirEntry type. scandir() can also be easily
implemented in terms of ilistdir().
|
| |
|
|
|
|
|
|
|
|
|
| |
This allows the mp_obj_t type to be configured to something other than a
pointer-sized primitive type.
This patch also includes additional changes to allow the code to compile
when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of
mp_uint_t, and various casts.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Dependency of upip.
|
|
|
|
| |
Dependency of upip.
|
| |
|
| |
|
|
|
|
| |
E.g. Windows lacks this header.
|
|
|
|
|
|
|
|
|
|
|
| |
Another function (like stat) which is problematic to deal with on ABI level
(FFI), as struct statvfs layout may differ unpredictably between OSes and
even different versions of a same OS. So, implement it in C, returning a
10-element tuple of f_bsize, f_frsize, f_blocks, f_bfree, f_bavail, f_files,
f_ffree, f_favail, f_flag, f_namemax. This is exactly the order described
in Python3 docs, https://docs.python.org/3/library/os.html#os.statvfs
(but note that os.statvfs() should make these values available as
attributes).
|
| |
|
|
|
|
|
|
| |
system() is the basic function to support automation of tasks, so have it
available builtin, for example, for bootstrapping rest of micropython
environment.
|
| |
|
|
|
|
|
| |
This is just a clean-up of the code. Generated code is exactly the
same.
|
|
|
|
| |
Part of code cleanup, working towards resolving issue #50.
|
|
|
|
| |
Addresses issue #724.
|
|
|
|
| |
See discussion in issue #50.
|
|
|
|
| |
This fixes count_lead_ones in misc.h not compiling due to unknown types
|
| |
|
|
|
|
|
|
|
|
| |
cast error in MP_OBJ_NEW_SMALL_INT(). This is necessary for FreeBSD, where
st_ino is of different size
- If MP_CLOCKS_PER_SEC is defined on the target host, simply define CLOCK_DIV
as a fraction, regardless of the value of MP_CLOCKS_PER_SEC.
FreeBSD uses a non-POSIX compliant value of 128 for CLOCKS_PER_SEC
|
| |
|
| |
|
| |
|
|
stat() is bad function to use using FFI, because its ABI is largely private.
To start with, Glibc .so doesn't even have "stat" symbol. Then, layout of
struct stat is too implementation-dependent. So, introduce _os to deal
with stat() and other similar cases.
|