aboutsummaryrefslogtreecommitdiff
path: root/extmod/vfs_fat_file.c
AgeCommit message (Collapse)Author
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2019-12-27py: Introduce MP_ROM_NONE macro for ROM to refer to None object.Damien George
This helps to prevent mistakes, and allows easily changing the ROM value of None if needed.
2019-08-20extmod: Give vars/funcs unique names so STATIC can be set to nothing.Damien George
Fixes issue #5018.
2018-06-06extmod/vfs_fat: Rename FileIO/TextIO types to mp_type_vfs_fat_XXX.Damien George
So they don't clash with other VFS implementations.
2018-04-10py/stream: Switch stream close operation from method to ioctl.Damien George
This patch moves the implementation of stream closure from a dedicated method to the ioctl of the stream protocol, for each type that implements closing. The benefits of this are: 1. Rounds out the stream ioctl function, which already includes flush, seek and poll (among other things). 2. Makes calling mp_stream_close() on an object slightly more efficient because it now no longer needs to lookup the close method and call it, rather it just delegates straight to the ioctl function (if it exists). 3. Reduces code size and allows future types that implement the stream protocol to be smaller because they don't need a dedicated close method. Code size reduction is around 200 bytes smaller for x86 archs and around 30 bytes smaller for the bare-metal archs.
2018-02-23extmod/vfs_fat: Make fat_vfs_open_obj wrapper public, not its function.Damien George
This patch just moves the definition of the wrapper object fat_vfs_open_obj to the location of the definition of its function, which matches how it's done in most other places in the code base.
2018-01-31extmod/vfs_fat_file: Implement SEEK_CUR for non-zero offset.Ayke van Laethem
CPython doesn't allow SEEK_CUR with non-zero offset for files in text mode, and uPy inherited this behaviour for both text and binary files. It makes sense to provide full support for SEEK_CUR of binary-mode files in uPy, and to do this in a minimal way means also allowing to use SEEK_CUR with non-zero offsets on text-mode files. That seems to be a fair compromise.
2017-10-04all: Remove inclusion of internal py header files.Damien George
Header files that are considered internal to the py core and should not normally be included directly are: py/nlr.h - internal nlr configuration and declarations py/bc0.h - contains bytecode macro definitions py/runtime0.h - contains basic runtime enums Instead, the top-level header files to include are one of: py/obj.h - includes runtime0.h and defines everything to use the mp_obj_t type py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h, and defines everything to use the general runtime support functions Additional, specific headers (eg py/objlist.h) can be included if needed.
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-24all: Don't include system errno.h when it's not needed.Damien George
2017-03-13extmod/vfs_fat: Allow to compile with MICROPY_VFS_FAT disabled.Damien George
Some ports may want to compile with generic MICROPY_VFS support but without the VfsFat class. This patch allows such a thing.
2017-02-16py: Add iter_buf to getiter type method.Damien George
Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
2017-01-30extmod/vfs_fat: Remove unused fatfs_builtin_open function.Damien George
2017-01-30extmod: Merge old fsusermount.h header into vfs.h and vfs_fat.h.Damien George
vfs.h is for generic VFS declarations, and vfs_fat.h is for VfsFat specific things.
2017-01-30extmod/vfs_fat: Remove MICROPY_FATFS_OO config option.Damien George
Everyone should now be using the new ooFatFs library. The old one is no longer supported and will be removed.
2017-01-30extmod: Remove MICROPY_FSUSERMOUNT and related files.Damien George
Replaced by MICROPY_VFS and the VFS sub-system.
2017-01-30extmod/vfs_fat: Remove MICROPY_FSUSERMOUNT_ADHOC config option.Damien George
2017-01-27extmod/vfs_fat: Rework to support new generic VFS sub-system.Damien George
The VfsFat object can now be mounted by the generic VFS sub-system.
2017-01-27extmod: Rename vfs_fat_file.h to vfs_fat.h.Damien George
And move declaration of mp_fat_vfs_type to this file.
2017-01-27extmod/vfs_fat: Rework so it can optionally use OO version of FatFS.Damien George
If MICROPY_VFS_FAT is enabled by a port then the port must switch to using MICROPY_FATFS_OO. Otherwise a port can continue to use the FatFs code without any changes.
2016-12-02extmod/vfs_fat_file: Allow file obj to respond to ioctl flush request.w4kpm
2016-11-14all: Remove readall() method, which is equivalent to read() w/o args.Paul Sokolovsky
Its addition was due to an early exploration on how to add CPython-like stream interface. It's clear that it's not needed and just takes up bytes in all ports.
2016-10-24extmod/vfs_fat_file: Make file.close() a no-op if file already closed.Damien George
As per CPython semantics. In particular, file.__del__() should not raise an exception if the file is already closed.
2016-10-19extmod/vfs_fat_file: Check fatfs f_sync() and f_close() returns for errors.Alex March
2016-10-07extmod/vfs_fat_file: Use MP_Exxx errno constants.Damien George
2016-10-07extmod/vfs_fat: Use mp_raise_OSError helper function.Damien George
2016-06-18all: Rename mp_obj_type_t::stream_p to protocol.Paul Sokolovsky
It's now used for more than just stream protocol (e.g. pin protocol), so don't use false names.
2016-03-14py: When printf'ing an object as a pointer, pass the concrete pointer.Damien George
2016-02-15cc3200: Fix breakage after VfsFat refactor.Paul Sokolovsky
2016-02-15extmod/vfs_fat_file: Reusable FatFs module, move from stmhal/file.Paul Sokolovsky