Samwise wrote:
PaulDv's code is exactly what I was looking for. It's going in a BASIC menu, so that fits the bill perfectly.
You shouldn't unnessessarily restrict your program's functionality when it's running on DFS unless it's absolutely neccessary. Especially, don't make your program jump through complicated hoops for DFS when non-specific filing systems calls do the job just as well. I've seen abominations of code that effectively do:
IF (NOT DFS) THEN use API to read directory
ELSE VDU 21, *CAT, VDU 6, peek memory
when the correct code is just... use API to read directory.
Also, as some filing systems that respond with fs=4 have more functionality than Acorn DFS (eg HDFS, WatfordDFS), and some filing systems that respond with fs<>4 actually have the same functionality as DFS (eg RetroRAMFS), in some cases a better test is:
dfs%=FNfile("$",5)<>2. See the
Wiki article.
(PS: Is there any way to get
inline code in the above paragraph,
not having appear as a seperate paragraph?)