Should RISC OS flush files to storage on close?
Timothy Baldwin (184) 242 posts |
The PRM as included with DDE 27 states that for OS_File 0 “Any modified data held in RAM buffers is first written to the file(s).” and FileSwitch calls FSEntry_Args 6 (flush to storage) for files before closing them. However:
Does anyone know of any programs that rely on flush on close to preserve data integrity in case of power failure etc? What is the behaviour of other existing filing systems? Would it be acceptable for a RISC OS filing system not to flush to storage on close by default? An special field option could be used to enable a backward compatible mode, and FileSwitch would need to be changed not to call FSEntry_Args 6 on close if requested. |
Matthew Phillips (473) 721 posts |
I think that when DiscKnight was in development I remember people saying that RISC OS tended to be more reliable that Windows when it came to the filesystem not getting in a mess, but that will be because of the fact that most operations are flushed when the file is closed. I can see that caching more and flushing less would have a benefit in performance, but given the fact that a badly-written application can cause the whole machine to seize up without any way of regaining control, it would have some downsides too. Of the non-FileCore filing systems, aside from those you have already mentioned I should think FAT32FS is probably the most heavily used. I think it does not write the FAT back at every possible opportunity and possibly has caching of file content on write as well. |
Timothy Baldwin (184) 242 posts |
DiscKnight was written around 2000 so that would be contemporary with Windows 98/ME. Modern filing systems such as NTFS, Btrfs and Ext4 are more robust. However filing system consistency was not the point of my question.
Not a problem if the cache is outside RISC OS controlled by some operating system with full memory protection.
The documentation does state there is write behind caching and examination of the source reveals it ignores FSEntry_Args 6 and does not flush on close either. |
Timothy Baldwin (184) 242 posts |
DOSFS, ArcFSr/w, TBAFS, and StrongHelp are also broken, I’ve verified that OS_Args 255 is not propagated down to the underlying filing system. |