rtel wrote on Wednesday, June 18, 2014:
The file system has a fairly standard API, so files are created in the same way they would be with any other standard file system. Also, if you have the Win32 simulator demo running, and step through the code, you will see the files being created - as it uses a RAM disk when the disk is initialised there are no files on it, then there is a loop that creates the files, then loops that read back from the files to ensure they are correct, plus CLI commands to copy files (which involves creating a new file), etc.
In the Win32 simulator demo, find the file File-system-demo.c, then in that file find the function vCreateAndVerifySampleFiles(). That function calls two further functions: prvCreateDemoFilesUsing_f_write() and prvCreateDemoFileUsing_f_putc().
Then, inside prvCreateDemoFilesUsing_f_write() you will see lines such as:
/* Open the file, creating the file if it does not already exist. */
pxFile = f_open( cFileName, "w" );
…so you can see that files are automatically created if an attempt is made to open a file that does not exist.