summaryrefslogtreecommitdiffstatshomepage
path: root/unix/modos.c
Commit message (Collapse)AuthorAge
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* unix: Use mp_obj_str_get_str instead of mp_obj_str_get_data.Damien George2017-03-25
|
* unix/modos: Remove VfsFat from uos module, it's now in uos_vfs module.Damien George2017-01-30
|
* extmod: Remove MICROPY_FSUSERMOUNT and related files.Damien George2017-01-30
| | | | Replaced by MICROPY_VFS and the VFS sub-system.
* extmod: Rename vfs_fat_file.h to vfs_fat.h.Damien George2017-01-27
| | | | And move declaration of mp_fat_vfs_type to this file.
* py: Be more specific with MP_DECLARE_CONST_FUN_OBJ macros.Damien George2016-10-21
| | | | | | | In order to have more fine-grained control over how builtin functions are constructed, the MP_DECLARE_CONST_FUN_OBJ macros are made more specific, with suffix of _0, _1, _2, _3, _VAR, _VAR_BETEEN or _KW. These names now match the MP_DEFINE_CONST_FUN_OBJ macros.
* unix: Use common RAISE_ERRNO macro from mphalport.h.Damien George2016-10-07
|
* unix: Use mp_raise_OSError helper function.Damien George2016-10-07
|
* all: Remove 'name' member from mp_obj_module_t struct.Damien George2016-09-22
| | | | One can instead lookup __name__ in the modules dict to get the value.
* unix: Enable VfsFat support.Paul Sokolovsky2016-02-14
|
* py: Change type signature of builtin funs that take variable or kw args.Damien George2016-01-11
| | | | | With this patch the n_args parameter is changed type from mp_uint_t to size_t.
* extmod/moduos_dupterm: Make uos.dupterm() implementation reusable.Paul Sokolovsky2016-01-01
| | | | | That's just function which sets/gets dup terminal object, and can be easily reused across ports.
* unix: Implement uos.dupterm(). Conditional on MICROPY_PY_OS_DUPTERM.Paul Sokolovsky2015-12-28
|
* unix: Change define logic of _DIRENT_HAVE_D_INO to match other macros.Damien George2015-12-16
|
* unix/modos: Fix silly bugs in ilistdir tuple creation.Damien George2015-12-16
|
* unix/modos: Allow to configure use of d_ino using _DIRENT_HAVE_D_INO.Damien George2015-12-16
| | | | Ports will need to #define _DIRENT_HAVE_D_INO (0) to disable d_ino use.
* uos: Add errno() function to get/set errno value.Paul Sokolovsky2015-12-16
|
* unix/modos: Implement ilistdir().Paul Sokolovsky2015-12-14
| | | | | | | | | | | | 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().
* unix: Rename "_os" module to "uos" for consistency with baremetal ports.Paul Sokolovsky2015-12-12
|
* py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR.Damien George2015-11-29
| | | | | | | | | 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.
* py: Add MP_ROM_* macros and mp_rom_* types and use them.Damien George2015-11-29
|
* unix/modos: Remove duplicate level of #if MICROPY_PY_OS_STATVFS.Paul Sokolovsky2015-11-26
|
* unix/modos: getenv(): Handle non-existing envvar correctly.Paul Sokolovsky2015-11-14
|
* unix/modos: Add Windows workaround for mkdir().Paul Sokolovsky2015-11-14
|
* unix/modos: Add mkdir().Paul Sokolovsky2015-11-13
| | | | Dependency of upip.
* unix/modos: Add getenv().Paul Sokolovsky2015-11-13
| | | | Dependency of upip.
* unix/modos: Android Bionic lacks statvfs(), has BSD statfs().Paul Sokolovsky2015-10-19
|
* unix/modos: Checking config macros requires mpconfig.h.Paul Sokolovsky2015-10-18
|
* unix/modos: Guard sys/statvfs.h include with MICROPY_PY_OS_STATVFS check.Paul Sokolovsky2015-10-18
| | | | E.g. Windows lacks this header.
* unix/modos: Add statvfs() function.Paul Sokolovsky2015-10-18
| | | | | | | | | | | 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).
* unix: Prefix includes with py/; remove need for -I../py.Damien George2015-01-01
|
* unix, windows: Add _os.system() call.Paul Sokolovsky2014-12-23
| | | | | | system() is the basic function to support automation of tasks, so have it available builtin, for example, for bootstrapping rest of micropython environment.
* unix: add unlink function to os moduleNikita Nazarenko2014-12-10
|
* Use MP_DEFINE_CONST_DICT macro to define module dicts.Damien George2014-11-29
| | | | | This is just a clean-up of the code. Generated code is exactly the same.
* py: Change all uint to mp_uint_t in obj.h.Damien George2014-08-30
| | | | Part of code cleanup, working towards resolving issue #50.
* py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.Damien George2014-07-31
| | | | Addresses issue #724.
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* unix: Fix mpconfig.h not being included before misc.hstijn2014-06-28
| | | | This fixes count_lead_ones in misc.h not compiling due to unknown types
* Prefix ARRAY_SIZE with micropython prefix MP_Emmanuel Blot2014-06-19
|
* - Cast the struct stat sb.st_ino field to machine_int_t explicitly to avoid aMarcus von Appen2014-06-07
| | | | | | | | 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
* modos: stat(): Accept bytes argument.Paul Sokolovsky2014-05-26
|
* unix: Fix casting issue, int to small int object.Damien George2014-05-21
|
* modos: Clean 64-bit issues.Paul Sokolovsky2014-05-15
|
* unix: Add "_os" module with stat().Paul Sokolovsky2014-05-14
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.