Lines Matching refs:file

216 	struct fs_file_t file;  in cmd_trunc()  local
228 fs_file_t_init(&file); in cmd_trunc()
229 err = fs_open(&file, path, FS_O_WRITE); in cmd_trunc()
235 err = fs_truncate(&file, length); in cmd_trunc()
241 fs_close(&file); in cmd_trunc()
282 struct fs_file_t file; in cmd_read() local
318 fs_file_t_init(&file); in cmd_read()
319 err = fs_open(&file, path, FS_O_READ); in cmd_read()
326 err = fs_seek(&file, offset, FS_SEEK_SET); in cmd_read()
330 fs_close(&file); in cmd_read()
340 read = fs_read(&file, buf, MIN(count, sizeof(buf))); in cmd_read()
367 fs_close(&file); in cmd_read()
377 struct fs_file_t file; in cmd_cat() local
381 fs_file_t_init(&file); in cmd_cat()
398 err = fs_open(&file, path, FS_O_READ); in cmd_cat()
405 read = fs_read(&file, buf, sizeof(buf)); in cmd_cat()
420 fs_close(&file); in cmd_cat()
453 struct fs_file_t file; in cmd_write() local
472 fs_file_t_init(&file); in cmd_write()
473 err = fs_open(&file, path, FS_O_CREATE | FS_O_WRITE); in cmd_write()
480 err = fs_seek(&file, 0, FS_SEEK_END); in cmd_write()
482 err = fs_seek(&file, offset, FS_SEEK_SET); in cmd_write()
486 fs_close(&file); in cmd_write()
495 err = fs_write(&file, buf, buf_len); in cmd_write()
499 fs_close(&file); in cmd_write()
507 fs_close(&file); in cmd_write()
552 struct fs_file_t file; in cmd_read_test() local
595 fs_file_t_init(&file); in cmd_read_test()
596 err = fs_open(&file, path, FS_O_READ); in cmd_read_test()
605 err = fs_read(&file, random_data, sizeof(random_data)); in cmd_read_test()
609 fs_close(&file); in cmd_read_test()
622 fs_close(&file); in cmd_read_test()
644 struct fs_file_t file; in cmd_erase_write_test() local
684 fs_file_t_init(&file); in cmd_erase_write_test()
685 err = fs_open(&file, path, FS_O_CREATE | FS_O_WRITE); in cmd_erase_write_test()
692 err = fs_truncate(&file, 0); in cmd_erase_write_test()
695 fs_close(&file); in cmd_erase_write_test()
703 err = fs_open(&file, path, FS_O_CREATE | FS_O_WRITE); in cmd_erase_write_test()
710 fs_close(&file); in cmd_erase_write_test()
723 err = fs_write(&file, random_data, write_size); in cmd_erase_write_test()
727 fs_close(&file); in cmd_erase_write_test()
735 fs_sync(&file); in cmd_erase_write_test()
736 fs_close(&file); in cmd_erase_write_test()