littlefs-python 0.13.0__tar.gz → 0.13.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/.github/workflows/deploy.yml +1 -1
  2. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/PKG-INFO +10 -2
  3. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/lfs.c +2 -7
  4. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_seek.toml +148 -1
  5. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs/__main__.py +1 -0
  6. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs/lfs.c +6 -6
  7. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs_python.egg-info/PKG-INFO +10 -2
  8. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/.gitattributes +0 -0
  9. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/.github/dependabot.yml +0 -0
  10. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/.github/workflows/run-tests.yml +0 -0
  11. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/.gitignore +0 -0
  12. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/.gitmodules +0 -0
  13. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/.pre-commit-config.yaml +0 -0
  14. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/.readthedocs.yml +0 -0
  15. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/LICENSE +0 -0
  16. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/MANIFEST.in +0 -0
  17. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/README.rst +0 -0
  18. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/ci/build-wheels.sh +0 -0
  19. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/ci/download_release_files.py +0 -0
  20. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/Makefile +0 -0
  21. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/api/index.rst +0 -0
  22. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/cli.rst +0 -0
  23. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/conf.py +0 -0
  24. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/doc8.ini +0 -0
  25. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/examples/index.rst +0 -0
  26. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/index.rst +0 -0
  27. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/make.bat +0 -0
  28. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/requirements.txt +0 -0
  29. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/docs/usage.rst +0 -0
  30. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/examples/mkfsimg.py +0 -0
  31. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/examples/walk.py +0 -0
  32. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/.git +0 -0
  33. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/.gitattributes +0 -0
  34. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/.github/workflows/post-release.yml +0 -0
  35. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/.github/workflows/release.yml +0 -0
  36. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/.github/workflows/status.yml +0 -0
  37. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/.github/workflows/test.yml +0 -0
  38. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/.gitignore +0 -0
  39. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/DESIGN.md +0 -0
  40. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/LICENSE.md +0 -0
  41. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/Makefile +0 -0
  42. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/README.md +0 -0
  43. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/SPEC.md +0 -0
  44. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/bd/lfs_emubd.c +0 -0
  45. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/bd/lfs_emubd.h +0 -0
  46. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/bd/lfs_filebd.c +0 -0
  47. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/bd/lfs_filebd.h +0 -0
  48. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/bd/lfs_rambd.c +0 -0
  49. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/bd/lfs_rambd.h +0 -0
  50. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/benches/bench_dir.toml +0 -0
  51. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/benches/bench_file.toml +0 -0
  52. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/benches/bench_superblock.toml +0 -0
  53. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/lfs.h +0 -0
  54. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/lfs_util.c +0 -0
  55. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/lfs_util.h +0 -0
  56. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/runners/bench_runner.c +0 -0
  57. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/runners/bench_runner.h +0 -0
  58. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/runners/test_runner.c +0 -0
  59. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/runners/test_runner.h +0 -0
  60. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/bench.py +0 -0
  61. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/changeprefix.py +0 -0
  62. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/code.py +0 -0
  63. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/cov.py +0 -0
  64. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/data.py +0 -0
  65. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/perf.py +0 -0
  66. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/perfbd.py +0 -0
  67. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/plot.py +0 -0
  68. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/plotmpl.py +0 -0
  69. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/prettyasserts.py +0 -0
  70. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/readblock.py +0 -0
  71. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/readmdir.py +0 -0
  72. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/readtree.py +0 -0
  73. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/stack.py +0 -0
  74. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/structs.py +0 -0
  75. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/summary.py +0 -0
  76. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/tailpipe.py +0 -0
  77. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/teepipe.py +0 -0
  78. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/test.py +0 -0
  79. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/tracebd.py +0 -0
  80. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/scripts/watch.py +0 -0
  81. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_alloc.toml +0 -0
  82. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_attrs.toml +0 -0
  83. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_badblocks.toml +0 -0
  84. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_bd.toml +0 -0
  85. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_compat.toml +0 -0
  86. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_dirs.toml +0 -0
  87. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_entries.toml +0 -0
  88. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_evil.toml +0 -0
  89. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_exhaustion.toml +0 -0
  90. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_files.toml +0 -0
  91. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_interspersed.toml +0 -0
  92. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_move.toml +0 -0
  93. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_orphans.toml +0 -0
  94. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_paths.toml +0 -0
  95. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_powerloss.toml +0 -0
  96. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_relocations.toml +0 -0
  97. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_superblocks.toml +0 -0
  98. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/littlefs/tests/test_truncate.toml +0 -0
  99. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/mypy.ini +0 -0
  100. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/pyproject.toml +0 -0
  101. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/requirements.txt +0 -0
  102. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/setup.cfg +0 -0
  103. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/setup.py +0 -0
  104. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs/__init__.py +0 -0
  105. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs/context.py +0 -0
  106. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs/errors.py +0 -0
  107. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs/lfs.pxd +0 -0
  108. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs/lfs.pyi +0 -0
  109. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs/lfs.pyx +0 -0
  110. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs/py.typed +0 -0
  111. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs_python.egg-info/SOURCES.txt +0 -0
  112. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs_python.egg-info/dependency_links.txt +0 -0
  113. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs_python.egg-info/entry_points.txt +0 -0
  114. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs_python.egg-info/not-zip-safe +0 -0
  115. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs_python.egg-info/requires.txt +0 -0
  116. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/src/littlefs_python.egg-info/top_level.txt +0 -0
  117. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/lfs/conftest.py +0 -0
  118. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/lfs/test_dir_functions.py +0 -0
  119. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/lfs/test_file_functions.py +0 -0
  120. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/lfs/test_fs_functions.py +0 -0
  121. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_attr.py +0 -0
  122. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_block_count.py +0 -0
  123. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_directories.py +0 -0
  124. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_files.py +0 -0
  125. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_grow.py +0 -0
  126. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_multiversion.py +0 -0
  127. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_name_max.py +0 -0
  128. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_remove_rename.py +0 -0
  129. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_version.py +0 -0
  130. {littlefs_python-0.13.0 → littlefs_python-0.13.2}/test/test_walk.py +0 -0
@@ -109,7 +109,7 @@ jobs:
109
109
  pattern: wheels-*
110
110
  merge-multiple: true
111
111
 
112
- - uses: pypa/gh-action-pypi-publish@v1.12.2
112
+ - uses: pypa/gh-action-pypi-publish@v1.12.4
113
113
  with:
114
114
  user: __token__
115
115
  password: ${{ secrets.pypi_api_token }}
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: littlefs-python
3
- Version: 0.13.0
3
+ Version: 0.13.2
4
4
  Summary: A python wrapper for littlefs
5
5
  Home-page: https://github.com/jrast/littlefs-python
6
6
  Author: Jürg Rast
@@ -21,6 +21,14 @@ Classifier: Topic :: System :: Filesystems
21
21
  Description-Content-Type: text/x-rst
22
22
  License-File: LICENSE
23
23
  Requires-Dist: importlib-metadata>=4.4; python_version < "3.10"
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: requires-dist
31
+ Dynamic: summary
24
32
 
25
33
  ===================
26
34
  littlefs for Python
@@ -3725,13 +3725,8 @@ static lfs_soff_t lfs_file_seek_(lfs_t *lfs, lfs_file_t *file,
3725
3725
 
3726
3726
  // if we're only reading and our new offset is still in the file's cache
3727
3727
  // we can avoid flushing and needing to reread the data
3728
- if (
3729
- #ifndef LFS_READONLY
3730
- !(file->flags & LFS_F_WRITING)
3731
- #else
3732
- true
3733
- #endif
3734
- ) {
3728
+ if ((file->flags & LFS_F_READING)
3729
+ && file->off != lfs->cfg->block_size) {
3735
3730
  int oindex = lfs_ctz_index(lfs, &(lfs_off_t){file->pos});
3736
3731
  lfs_off_t noff = npos;
3737
3732
  int nindex = lfs_ctz_index(lfs, &noff);
@@ -137,6 +137,130 @@ code = '''
137
137
  lfs_unmount(&lfs) => 0;
138
138
  '''
139
139
 
140
+ # boundary seek and reads
141
+ [cases.test_seek_boundary_read]
142
+ defines.COUNT = 132
143
+ code = '''
144
+ lfs_t lfs;
145
+ lfs_format(&lfs, cfg) => 0;
146
+ lfs_mount(&lfs, cfg) => 0;
147
+ lfs_file_t file;
148
+ lfs_file_open(&lfs, &file, "kitty",
149
+ LFS_O_WRONLY | LFS_O_CREAT | LFS_O_APPEND) => 0;
150
+ size_t size = strlen("kittycatcat");
151
+ uint8_t buffer[1024];
152
+ memcpy(buffer, "kittycatcat", size);
153
+ for (int j = 0; j < COUNT; j++) {
154
+ lfs_file_write(&lfs, &file, buffer, size);
155
+ }
156
+ lfs_file_close(&lfs, &file) => 0;
157
+ lfs_unmount(&lfs) => 0;
158
+
159
+ lfs_mount(&lfs, cfg) => 0;
160
+ lfs_file_open(&lfs, &file, "kitty", LFS_O_RDONLY) => 0;
161
+
162
+ size = strlen("kittycatcat");
163
+ const lfs_soff_t offsets[] = {
164
+ 512,
165
+ 1024-4,
166
+ 512+1,
167
+ 1024-4+1,
168
+ 512-1,
169
+ 1024-4-1,
170
+
171
+ 512-strlen("kittycatcat"),
172
+ 1024-4-strlen("kittycatcat"),
173
+ 512-strlen("kittycatcat")+1,
174
+ 1024-4-strlen("kittycatcat")+1,
175
+ 512-strlen("kittycatcat")-1,
176
+ 1024-4-strlen("kittycatcat")-1,
177
+
178
+ strlen("kittycatcat")*(COUNT-2)-1,
179
+ };
180
+
181
+ for (unsigned i = 0; i < sizeof(offsets) / sizeof(offsets[0]); i++) {
182
+ lfs_soff_t off = offsets[i];
183
+ // read @ offset
184
+ lfs_file_seek(&lfs, &file, off, LFS_SEEK_SET) => off;
185
+ lfs_file_read(&lfs, &file, buffer, size) => size;
186
+ memcmp(buffer,
187
+ &"kittycatcatkittycatcat"[off % strlen("kittycatcat")],
188
+ size) => 0;
189
+ // read after
190
+ lfs_file_seek(&lfs, &file, off+strlen("kittycatcat")+1, LFS_SEEK_SET)
191
+ => off+strlen("kittycatcat")+1;
192
+ lfs_file_read(&lfs, &file, buffer, size) => size;
193
+ memcmp(buffer,
194
+ &"kittycatcatkittycatcat"[(off+1) % strlen("kittycatcat")],
195
+ size) => 0;
196
+ // read before
197
+ lfs_file_seek(&lfs, &file, off-strlen("kittycatcat")-1, LFS_SEEK_SET)
198
+ => off-strlen("kittycatcat")-1;
199
+ lfs_file_read(&lfs, &file, buffer, size) => size;
200
+ memcmp(buffer,
201
+ &"kittycatcatkittycatcat"[(off-1) % strlen("kittycatcat")],
202
+ size) => 0;
203
+
204
+ // read @ 0
205
+ lfs_file_seek(&lfs, &file, 0, LFS_SEEK_SET) => 0;
206
+ lfs_file_read(&lfs, &file, buffer, size) => size;
207
+ memcmp(buffer, "kittycatcat", size) => 0;
208
+
209
+ // read @ offset
210
+ lfs_file_seek(&lfs, &file, off, LFS_SEEK_SET) => off;
211
+ lfs_file_read(&lfs, &file, buffer, size) => size;
212
+ memcmp(buffer,
213
+ &"kittycatcatkittycatcat"[off % strlen("kittycatcat")],
214
+ size) => 0;
215
+ // read after
216
+ lfs_file_seek(&lfs, &file, off+strlen("kittycatcat")+1, LFS_SEEK_SET)
217
+ => off+strlen("kittycatcat")+1;
218
+ lfs_file_read(&lfs, &file, buffer, size) => size;
219
+ memcmp(buffer,
220
+ &"kittycatcatkittycatcat"[(off+1) % strlen("kittycatcat")],
221
+ size) => 0;
222
+ // read before
223
+ lfs_file_seek(&lfs, &file, off-strlen("kittycatcat")-1, LFS_SEEK_SET)
224
+ => off-strlen("kittycatcat")-1;
225
+ lfs_file_read(&lfs, &file, buffer, size) => size;
226
+ memcmp(buffer,
227
+ &"kittycatcatkittycatcat"[(off-1) % strlen("kittycatcat")],
228
+ size) => 0;
229
+
230
+ // sync
231
+ lfs_file_sync(&lfs, &file) => 0;
232
+
233
+ // read @ 0
234
+ lfs_file_seek(&lfs, &file, 0, LFS_SEEK_SET) => 0;
235
+ lfs_file_read(&lfs, &file, buffer, size) => size;
236
+ memcmp(buffer, "kittycatcat", size) => 0;
237
+
238
+ // read @ offset
239
+ lfs_file_seek(&lfs, &file, off, LFS_SEEK_SET) => off;
240
+ lfs_file_read(&lfs, &file, buffer, size) => size;
241
+ memcmp(buffer,
242
+ &"kittycatcatkittycatcat"[off % strlen("kittycatcat")],
243
+ size) => 0;
244
+ // read after
245
+ lfs_file_seek(&lfs, &file, off+strlen("kittycatcat")+1, LFS_SEEK_SET)
246
+ => off+strlen("kittycatcat")+1;
247
+ lfs_file_read(&lfs, &file, buffer, size) => size;
248
+ memcmp(buffer,
249
+ &"kittycatcatkittycatcat"[(off+1) % strlen("kittycatcat")],
250
+ size) => 0;
251
+ // read before
252
+ lfs_file_seek(&lfs, &file, off-strlen("kittycatcat")-1, LFS_SEEK_SET)
253
+ => off-strlen("kittycatcat")-1;
254
+ lfs_file_read(&lfs, &file, buffer, size) => size;
255
+ memcmp(buffer,
256
+ &"kittycatcatkittycatcat"[(off-1) % strlen("kittycatcat")],
257
+ size) => 0;
258
+ }
259
+
260
+ lfs_file_close(&lfs, &file) => 0;
261
+ lfs_unmount(&lfs) => 0;
262
+ '''
263
+
140
264
  # boundary seek and writes
141
265
  [cases.test_seek_boundary_write]
142
266
  defines.COUNT = 132
@@ -160,31 +284,54 @@ code = '''
160
284
  lfs_file_open(&lfs, &file, "kitty", LFS_O_RDWR) => 0;
161
285
 
162
286
  size = strlen("hedgehoghog");
163
- const lfs_soff_t offsets[] = {512, 1020, 513, 1021, 511, 1019, 1441};
287
+ const lfs_soff_t offsets[] = {
288
+ 512,
289
+ 1024-4,
290
+ 512+1,
291
+ 1024-4+1,
292
+ 512-1,
293
+ 1024-4-1,
294
+
295
+ 512-strlen("kittycatcat"),
296
+ 1024-4-strlen("kittycatcat"),
297
+ 512-strlen("kittycatcat")+1,
298
+ 1024-4-strlen("kittycatcat")+1,
299
+ 512-strlen("kittycatcat")-1,
300
+ 1024-4-strlen("kittycatcat")-1,
301
+
302
+ strlen("kittycatcat")*(COUNT-2)-1,
303
+ };
164
304
 
165
305
  for (unsigned i = 0; i < sizeof(offsets) / sizeof(offsets[0]); i++) {
166
306
  lfs_soff_t off = offsets[i];
307
+ // write @ offset
167
308
  memcpy(buffer, "hedgehoghog", size);
168
309
  lfs_file_seek(&lfs, &file, off, LFS_SEEK_SET) => off;
169
310
  lfs_file_write(&lfs, &file, buffer, size) => size;
311
+
312
+ // read @ offset
170
313
  lfs_file_seek(&lfs, &file, off, LFS_SEEK_SET) => off;
171
314
  lfs_file_read(&lfs, &file, buffer, size) => size;
172
315
  memcmp(buffer, "hedgehoghog", size) => 0;
173
316
 
317
+ // read @ 0
174
318
  lfs_file_seek(&lfs, &file, 0, LFS_SEEK_SET) => 0;
175
319
  lfs_file_read(&lfs, &file, buffer, size) => size;
176
320
  memcmp(buffer, "kittycatcat", size) => 0;
177
321
 
322
+ // read @ offset
178
323
  lfs_file_seek(&lfs, &file, off, LFS_SEEK_SET) => off;
179
324
  lfs_file_read(&lfs, &file, buffer, size) => size;
180
325
  memcmp(buffer, "hedgehoghog", size) => 0;
181
326
 
182
327
  lfs_file_sync(&lfs, &file) => 0;
183
328
 
329
+ // read @ 0
184
330
  lfs_file_seek(&lfs, &file, 0, LFS_SEEK_SET) => 0;
185
331
  lfs_file_read(&lfs, &file, buffer, size) => size;
186
332
  memcmp(buffer, "kittycatcat", size) => 0;
187
333
 
334
+ // read @ offset
188
335
  lfs_file_seek(&lfs, &file, off, LFS_SEEK_SET) => off;
189
336
  lfs_file_read(&lfs, &file, buffer, size) => size;
190
337
  memcmp(buffer, "hedgehoghog", size) => 0;
@@ -295,6 +295,7 @@ def get_parser():
295
295
  parser_list.add_argument(
296
296
  "--block-size",
297
297
  type=size_parser,
298
+ required=True,
298
299
  help="LittleFS block size.",
299
300
  )
300
301
 
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.0.11 */
1
+ /* Generated by Cython 3.0.12 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -70,10 +70,10 @@ END: Cython Metadata */
70
70
  #else
71
71
  #define __PYX_EXTRA_ABI_MODULE_NAME ""
72
72
  #endif
73
- #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
73
+ #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME
74
74
  #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
75
75
  #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
76
- #define CYTHON_HEX_VERSION 0x03000BF0
76
+ #define CYTHON_HEX_VERSION 0x03000CF0
77
77
  #define CYTHON_FUTURE_DIVISION 1
78
78
  #include <stddef.h>
79
79
  #ifndef offsetof
@@ -2119,7 +2119,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
2119
2119
  #if !CYTHON_VECTORCALL
2120
2120
  #if PY_VERSION_HEX >= 0x03080000
2121
2121
  #include "frameobject.h"
2122
- #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2122
+ #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
2123
2123
  #ifndef Py_BUILD_CORE
2124
2124
  #define Py_BUILD_CORE 1
2125
2125
  #endif
@@ -39453,7 +39453,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
39453
39453
  #include "compile.h"
39454
39454
  #include "frameobject.h"
39455
39455
  #include "traceback.h"
39456
- #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
39456
+ #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
39457
39457
  #ifndef Py_BUILD_CORE
39458
39458
  #define Py_BUILD_CORE 1
39459
39459
  #endif
@@ -42885,7 +42885,7 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name
42885
42885
 
42886
42886
  /* CoroutineBase */
42887
42887
  #include <frameobject.h>
42888
- #if PY_VERSION_HEX >= 0x030b00a6
42888
+ #if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
42889
42889
  #ifndef Py_BUILD_CORE
42890
42890
  #define Py_BUILD_CORE 1
42891
42891
  #endif
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: littlefs-python
3
- Version: 0.13.0
3
+ Version: 0.13.2
4
4
  Summary: A python wrapper for littlefs
5
5
  Home-page: https://github.com/jrast/littlefs-python
6
6
  Author: Jürg Rast
@@ -21,6 +21,14 @@ Classifier: Topic :: System :: Filesystems
21
21
  Description-Content-Type: text/x-rst
22
22
  License-File: LICENSE
23
23
  Requires-Dist: importlib-metadata>=4.4; python_version < "3.10"
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: description-content-type
29
+ Dynamic: home-page
30
+ Dynamic: requires-dist
31
+ Dynamic: summary
24
32
 
25
33
  ===================
26
34
  littlefs for Python