- size_t count = kfile_write(&file.fd, "Hello, world!", strlen("Hello, world!"));
- ASSERT(count == strlen("Hello, world!"));
-
-#else
-
- fat_create_file(dd, "log.txt", &dir_entry);
- fd = open_file_in_dir(fs, dd, "log.txt");
- int32_t offset = 0;
- fat_seek_file(fd, &offset, FAT_SEEK_END);
+ /* preallocate file */
+ #if FILE_PREALLOC_SIZE
+ {
+ LED_ON();
+ for (int i = 0; i < (int)(FILE_PREALLOC_SIZE / sizeof(buf)); ++i)
+ fat_write_file(fd, (void *)buf, sizeof(buf));