This has always been the problem with substitution devices. One solution would be to rewrite the io.fstrg/fs.headr/etc code to substitute the filenames read as well (essentially chop off the directory path substituted). In case of io.fstrg this means checking if the channel is opened for directory access, then check if the data read would be a file header (length=64), then change the filename read accordingly. In your own example when using INKEY$ from BASIC this would fail because INKEY$ reads one byte at a time (using io.fbyte).
Another solution would be to make the DIR command 'substitution-aware' so it would recognise a substituted device and act accordingly. I've written a S*BASIC 'ls' like command (see https://github.com/janbredenbeek/QL/tree/master/SBASIC) which has implemented this (and it lists the contents of substituted subdirectories correctly). Jan. -- *Jan Bredenbeek* | Hilversum, NL | [email protected] _______________________________________________ QL-Users Mailing List
