Lines Matching refs:file
2 [[case]] # simple file test
6 lfs_file_open(&lfs, &file, "hello",
10 lfs_file_write(&lfs, &file, buffer, size) => size;
11 lfs_file_close(&lfs, &file) => 0;
15 lfs_file_open(&lfs, &file, "hello", LFS_O_RDONLY) => 0;
16 lfs_file_read(&lfs, &file, buffer, size) => size;
18 lfs_file_close(&lfs, &file) => 0;
30 lfs_file_open(&lfs, &file, "avacado",
38 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
40 lfs_file_close(&lfs, &file) => 0;
45 lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY) => 0;
46 lfs_file_size(&lfs, &file) => SIZE;
50 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
55 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
56 lfs_file_close(&lfs, &file) => 0;
69 lfs_file_open(&lfs, &file, "avacado",
77 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
79 lfs_file_close(&lfs, &file) => 0;
84 lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY) => 0;
85 lfs_file_size(&lfs, &file) => SIZE1;
89 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
94 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
95 lfs_file_close(&lfs, &file) => 0;
100 lfs_file_open(&lfs, &file, "avacado", LFS_O_WRONLY) => 0;
107 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
109 lfs_file_close(&lfs, &file) => 0;
114 lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY) => 0;
115 lfs_file_size(&lfs, &file) => lfs_max(SIZE1, SIZE2);
119 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
131 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
137 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
138 lfs_file_close(&lfs, &file) => 0;
151 lfs_file_open(&lfs, &file, "avacado",
159 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
161 lfs_file_close(&lfs, &file) => 0;
166 lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY) => 0;
167 lfs_file_size(&lfs, &file) => SIZE1;
171 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
176 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
177 lfs_file_close(&lfs, &file) => 0;
182 lfs_file_open(&lfs, &file, "avacado", LFS_O_WRONLY | LFS_O_APPEND) => 0;
189 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
191 lfs_file_close(&lfs, &file) => 0;
196 lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY) => 0;
197 lfs_file_size(&lfs, &file) => SIZE1 + SIZE2;
201 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
209 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
214 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
215 lfs_file_close(&lfs, &file) => 0;
228 lfs_file_open(&lfs, &file, "avacado",
236 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
238 lfs_file_close(&lfs, &file) => 0;
243 lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY) => 0;
244 lfs_file_size(&lfs, &file) => SIZE1;
248 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
253 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
254 lfs_file_close(&lfs, &file) => 0;
259 lfs_file_open(&lfs, &file, "avacado", LFS_O_WRONLY | LFS_O_TRUNC) => 0;
266 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
268 lfs_file_close(&lfs, &file) => 0;
273 lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY) => 0;
274 lfs_file_size(&lfs, &file) => SIZE2;
278 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
283 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
284 lfs_file_close(&lfs, &file) => 0;
288 [[case]] # reentrant file writing
299 err = lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY);
302 // can only be 0 (new file) or full size
303 size = lfs_file_size(&lfs, &file);
305 lfs_file_close(&lfs, &file) => 0;
309 lfs_file_open(&lfs, &file, "avacado", LFS_O_WRONLY | LFS_O_CREAT) => 0;
316 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
318 lfs_file_close(&lfs, &file) => 0;
321 lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY) => 0;
322 lfs_file_size(&lfs, &file) => SIZE;
326 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
331 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
332 lfs_file_close(&lfs, &file) => 0;
336 [[case]] # reentrant file writing with syncs
353 err = lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY);
357 size = lfs_file_size(&lfs, &file);
362 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
367 lfs_file_close(&lfs, &file) => 0;
371 lfs_file_open(&lfs, &file, "avacado",
373 size = lfs_file_size(&lfs, &file);
385 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
386 lfs_file_sync(&lfs, &file) => 0;
388 lfs_file_close(&lfs, &file) => 0;
391 lfs_file_open(&lfs, &file, "avacado", LFS_O_RDONLY) => 0;
392 lfs_file_size(&lfs, &file) => SIZE;
396 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
401 lfs_file_read(&lfs, &file, buffer, CHUNKSIZE) => 0;
402 lfs_file_close(&lfs, &file) => 0;
414 lfs_file_open(&lfs, &file, path,
419 lfs_file_write(&lfs, &file, wbuffer, size) => size;
420 lfs_file_close(&lfs, &file) => 0;
423 lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
424 lfs_file_read(&lfs, &file, rbuffer, size) => size;
426 lfs_file_close(&lfs, &file) => 0;
439 lfs_file_open(&lfs, &file, path,
444 lfs_file_write(&lfs, &file, wbuffer, size) => size;
445 lfs_file_close(&lfs, &file) => 0;
450 lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
451 lfs_file_read(&lfs, &file, rbuffer, size) => size;
453 lfs_file_close(&lfs, &file) => 0;
470 err = lfs_file_open(&lfs, &file, path, LFS_O_WRONLY | LFS_O_CREAT);
474 if ((lfs_size_t)lfs_file_size(&lfs, &file) != size) {
475 lfs_file_write(&lfs, &file, wbuffer, size) => size;
477 lfs_file_close(&lfs, &file) => 0;
480 lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) => 0;
481 lfs_file_read(&lfs, &file, rbuffer, size) => size;
483 lfs_file_close(&lfs, &file) => 0;