Unless there are other issues (like write protect on, or drive not ready, etc.), you either get 62,FILE NOT FOUND,00,00 or 63,FILE EXISTS,00,00 in DS$ ... which exactly match the information you want to know.

And this method also has the charm it works independent of CBM DOS file type.

Cheers,

Michael

*) actually your example would instead fail with files of one byte length, as EOF in ST already is signalled with the last byte sent!

Edit: actually, CBM DOS doesn't correctly handle one-byte-length files, either - in both cases (zero-length, one byte) a read back results in a file having four bytes length. This happens on the 1541 and 1581 (and presumably, also the 1571).