Op Sat, 21 Apr 2012 16:10:15 +0200 schreef Ralf Reköndt
<ralf.rekoe...@t-online.de>:
Hmm, but the TK2 Manual states about OPEN_DIR, so, apart from Level 2,
it should be possible. But what kind of directory, if not Level 2?
Perhaps just the root one.
Section 10 Open and Close
The standard QL channel OPEN commands are redefined by Toolkit II
to use the data directory. In addition, Toolkit II provides a set
of functions for opening files either using a specified channel
number (as in the standard QL commands), or they will find and
return a vacant channel number. The functions also allow filing
system errors to be intercepted and processed by SuperBASIC
programs.
Commands
OPEN #channel, name open a file for read/write
OPEN_IN #channel, name open a file for input only
OPEN_NEW #channel, name open a new file
OPEN_OVER #channel, name open a new file, if it
exists it is overwritten
OPEN_DIR #channel, name open a directory
CLOSE #channels close channels
The problem is related to the FTEST command trying to open a file
rather than a directory to verify its existance. In SMSQ/E a directory
can be opened as a file, but in QDOS I don't think it can. The correct
way to check for the validity of devices and directories would be to
attempt to open a directory, not a file (TRAP#2 with D0=1 and D3=4
rather than D3=1).
The Function FOP_DIR can be used but is not very reliable.
I did a quick QDOS test on my demo Q-emuLator where win1_ is a W$ folder,
win2_ is a QL floppy.
chn= FOP_DIR (win1_): PRINT FTYP(#chn): produced 255.
chn= FOP_DIR (win1_mach_): PRINT FTYP (#chn): also produced 255 while
mach_ is part of a filename and not a directory!
Even chn FOP_DIR ("win1_ma"): PRINT FTYP (#chn): returned as valid
directory.
This was not the case with win2_, there a FTYP returned zero for
everything.
But chn= FOP_DIR (usb1): opened a channel to win2_, PRINT FTYP(#chn):
returned zero and DIR usb1_ gave the name of the floppy and the sector
count.
So this is here not a good level 1 test to see if a device or directory
actually exists.
Minerva gave the same results.
Mind you, even under QPC2 I can happily FOP_OVER (a_file) to my win8_,
which is a QXL.WIN on the cdrom!
Bob
--
The BSJR QL software site at: http://members.upc.nl/b.spelten/ql/
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm