stardot / b-em

An opensource BBC Micro emulator for Win32 and Linux
http://stardot.org.uk/forums/viewtopic.php?f=4&t=10823
GNU General Public License v2.0
112 stars 56 forks source link

VDFS: OPENUP creates a new file if it doesn't already exist #209

Closed soruk42 closed 8 months ago

soruk42 commented 10 months ago

On DFS and ADFS, trying to OPENUP a file that doesn't already exist returns 0. However, on VDFS it's non-zero and a new file is created. This anomaly is even more surprising when running BASIC 1 and OPENIN (which became OPENUP in BASIC 2+) creates a file!

hoglet67 commented 10 months ago

It might be worth running Tom Seddon's File System Test Suite on VDFS: https://github.com/tom-seddon/beeb-fstest

Dave

SteveFosdick commented 10 months ago

I have just run Tom's File System Test Suite. It needed hacking to detect VDFS and ADFS-like rather than DFS-like. Other than that it uses EXT#=, i.e. sets a file length from BASIC. This seems to be something introduced after BASIC 2 as that reports "Syntax Error". On a Master, it issues OSARGS with A=3 so I have implemented that, and fixed OSARGS A=1 so it extends the file if the pointer is moved beyond the end even if there no subsequent write,

It didn't detect this open for update issue, though. I have fixed that too, though.

SteveFosdick commented 10 months ago

https://github.com/stardot/b-em/commit/1431e7b0e527bc410288a6eedf5ce0cbbe7eac90

soruk42 commented 9 months ago

Thank you - confirmed fixed. 👍