You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been observed that the emulator can overwrite files, where on a real Agon you will see an Access denied error being reported.
This applies to saving files from BASIC, and copying or renaming files where the destination file already exists. Other applications that are using the mos_save API are also affected (it is strongly suggested that nano exhibits this behaviour too).
The underlying cause of this seems to incorrect behaviour of the fatfs f_open function.
Specifically when the MOS API uses f_open to create new files up to write them, it sets the flags FA_WRITE and FA_CREATE_NEW. When FA_CREATE_NEW is set and the file already exists, fatfs is supposed to return FR_EXISTS. It seems that in the emulator it must be returning FR_OK.
Essentially it seems that calling f_open with the FA_CREATE_NEW is currently behaving identically as if the FA_CREATE_ALWAYS flag was set, which is incorrect.
The text was updated successfully, but these errors were encountered:
It's been observed that the emulator can overwrite files, where on a real Agon you will see an
Access denied
error being reported.This applies to saving files from BASIC, and copying or renaming files where the destination file already exists. Other applications that are using the
mos_save
API are also affected (it is strongly suggested thatnano
exhibits this behaviour too).The underlying cause of this seems to incorrect behaviour of the fatfs
f_open
function.Specifically when the MOS API uses
f_open
to create new files up to write them, it sets the flagsFA_WRITE
andFA_CREATE_NEW
. WhenFA_CREATE_NEW
is set and the file already exists, fatfs is supposed to returnFR_EXISTS
. It seems that in the emulator it must be returningFR_OK
.Essentially it seems that calling
f_open
with theFA_CREATE_NEW
is currently behaving identically as if theFA_CREATE_ALWAYS
flag was set, which is incorrect.The text was updated successfully, but these errors were encountered: