   <span class="c">/* Create FAT volume */</span>
    res = f_mkfs("", FM_ANY, 0, work, sizeof work);
    if (res) ...

    <span class="c">/* Register work area */</span>
    f_mount(&amp;fs, "", 0);

    <span class="c">/* Create a file as new */</span>
    res = f_open(&amp;fil, "hello.txt", FA_CREATE_NEW | FA_WRITE);
    if (res) ...

    <span class="c">/* Write a message */</span>
    f_write(&amp;fil, "Hello, World!\r\n", 15, &amp;bw);
    if (bw != 15) ...

    <span class="c">/* Clos