It should create the file.
I don't have experience with the MKR family and no MKR boards so can only help theoretically. If I was stuck, I would start with one of the SD examples and see if that works.
Note:
When you modify code, you should post your latest version.