Commit Graph

29 Commits

Author SHA1 Message Date
Damien George
2acc087880 extmod/vfs_lfs: Add mtime support to littlefs files.
This commit adds support for modification time of files on littlefs v2
filesystems, using file attributes.  For some background see issue #6114.

Features/properties of this implementation:
- Only supported on littlefs2 (not littlefs1).
- Uses littlefs2's general file attributes to store the timestamp.
- The timestamp is 64-bits and stores nanoseconds since 1970/1/1 (if the
  range to the year 2554 is not enough then additional bits can be added to
  this timestamp by adding another file attribute).
- mtime is enabled by default but can be disabled in the constructor, eg:
  uos.mount(uos.VfsLfs2(bdev, mtime=False), '/flash')
- It's fully backwards compatible, existing littlefs2 filesystems will work
  without reformatting and timestamps will be added transparently to
  existing files (once they are opened for writing).
- Files without timestamps will open correctly, and stat will just return 0
  for their timestamp.
- mtime can be disabled or enabled each mount time and timestamps will only
  be updated if mtime is enabled (otherwise they will be untouched).

Signed-off-by: Damien George <damien@micropython.org>
2020-08-25 17:35:19 +10:00
Zenix27
e76c7466b6 docs: Change \* to * in argument lists.
Latest versions of Sphinx (at least 3.1.0) do not need the `*` escaped and
will render the `\` in the output if it is there, so remove it.

Fixes issue #6209.
2020-08-21 12:24:13 +10:00
David Lechner
1e6d18c915 docs: Fix Sphinx 3.x warnings, and enable warnings-as-errors on build.
This enables warnings as errors and fixes all current errors, namely:

- reference to terms in the glossary must now be explicit (:term:)
- method overloads must not be declared as a separate method or must
  use :noindex:
- 2 cases where `` should have been used instead of `
2020-06-05 21:42:17 +10:00
Peter Hinch
59746ac14a docs/library/uos.rst: Improve block devices section, and ioctl ret vals. 2020-01-22 16:37:31 +11:00
Jason Neal
7ef2f65114 docs/library: Add / to indicate positional-only args in library docs.
Removes the confusion of positional-only arguments which have defaults that
look like keyword arguments.
2020-01-12 13:44:59 +11:00
Jim Mussared
f3f7eb48da docs/library/uos.rst: Clarify why the extended interface exists. 2019-12-16 12:45:15 +11:00
Damien George
b310930dba docs/library/uos: Add notes and links about littlefs failures. 2019-12-10 16:58:53 +11:00
Jim Mussared
9a849cc7ca docs: Add littlefs docs and a filesystem tutorial. 2019-12-04 23:18:23 +11:00
Damien George
7a24b7f091 docs/library: Add documentation for extended block device protocol. 2019-10-29 14:17:29 +11:00
Mike Causer
a2c4cb484d docs: Fix spelling in various parts of the docs. 2019-10-16 14:08:28 +11:00
Yonatan Goldschmidt
9521399044 docs/uos: Document extra requirements on stream objs passed to dupterm.
This is only correct for the extmod/uos_dupterm.c implementation however,
as e.g cc3200 implementation does the mp_load_method() itself, and anyway
requires `read` instead of `readinto`.
2019-02-26 01:12:37 +11:00
Damien George
ab02abe96d docs/uos: Make it clear that block device block_num param is an index. 2018-06-28 13:25:10 +10:00
Tom Collins
4d3a92c67c extmod/vfs_fat: Add file size as 4th element of uos.ilistdir tuple. 2018-03-12 12:26:36 +11:00
Damien George
8359210e71 docs/library/uos: Document mount, umount, VfsFat and block devices. 2018-03-07 14:50:38 +11:00
Damien George
63b003d523 docs/library/uos: Create sections for distinct parts and document uname. 2018-03-07 14:49:25 +11:00
Paul Sokolovsky
3ff7040c8a docs/library: Add xrefs to "stream" dictionary entry for many modules. 2017-12-04 18:36:20 +02:00
Damien George
e30ba2f1c7 docs/library: Add description of "index" parameter to uos.dupterm(). 2017-08-29 16:50:28 +10:00
Paul Sokolovsky
465d84b7e7 docs/library: Add CPython docs xref to each pertinent module.
Cross-reference text/link is implemented as RST substitution, so easy to
consistently.
2017-07-02 15:37:31 +03:00
Paul Sokolovsky
f8ac28964d docs/{micropython,sys,uos}: Use markup adhering to the latest docs conventions. 2017-06-28 00:37:47 +03:00
Paul Sokolovsky
e91b1cdae3 docs/uos: Move cc3200 port legacy VFS mounting functions to its ref doc.
This patch also unconditionalizes uos.dupterm(), though exact interface
and semantics is yet to be defined.
2017-06-03 14:19:53 +03:00
Paul Sokolovsky
1ce44f3046 docs/uos: Deconditionalize, remove minor port-specific details.
For a couple of ports, there was information which directory is set
as current after boot. This information doesn't belong to "uos" module,
and is moved to boards' references (which actually already contained
information on which directory is chosen for boot, even if without
explicit mentioning that it becomes current directory, which is now
done).
2017-06-03 13:51:13 +03:00
Damien George
6d221fe284 docs/library/uos: Add description of uos.ilistdir() function. 2017-05-10 12:44:21 +10:00
Paul Sokolovsky
a0fb360f1b docs/library/uos: urandom: Generalize description.
Don't give a guarantee of HW RNG, only a possibility of its usage.
2017-04-16 09:22:47 +03:00
Paul Sokolovsky
906d58f6f2 docs/uos: De-conditionalize statvfs() description.
It's a standard function, and it's already described (in the library
intro) that for any given port, any function may be missing.
2017-04-05 11:44:10 +03:00
Paul Sokolovsky
ee3615d800 docs/uos: Remove mention of uos.sep.
MicroPython guarantees '/' to be a path separator, so extra constant taking
precious ROM space are not needed. MicroPython never had such constant, only
one vendor port had it (now unmaintained).
2017-02-14 13:14:46 +03:00
Alex March
00c1fc6d77 docs/uos: Add uos.statvfs() documentation. 2016-10-07 13:16:54 +11:00
Mike Causer
ce166e6b68 docs: Spelling mistakes 2016-08-02 11:17:46 +03:00
Damien George
e0f7e001e8 docs: Fix uos and utime heading underlines to be the correct length.
Otherwise Sphinx gives a warning.
2016-04-27 12:11:27 +01:00
Paul Sokolovsky
351ec6d4ab docs/library: "os" module is actually "uos". 2016-04-27 01:55:06 +03:00