The definition is
implied, IMHO. FNAME$ returns the name of the file. In
Qdos & co, unfortunately, the path happens to be part of the file name:
Code: Select all
ch = fop_in(<dev><dir><filename>): print fname$(#ch)
This prints the name of the file, ie <dir><filename>
A directory is special, but it is also just a file, so that
Code: Select all
ch = fop_dir(<dev><dir>): print fname$(#ch)
and
Code: Select all
ch = fop_in(<dev><dir>): print fname$(#ch)
Both print <dir>, and so does, normally
Code: Select all
ch = fop_dir(<dev><dir><filename>): print fname$(#ch)
ie, it prints <dir>
Surely, this must be considered the normal - and expected - behaviour?
Arguably, FNAME$ should really only return the actual name of the file,
sans the directory, but oh well.
But this I do find unusual and unexpected:
Code: Select all
ch=fop_dir("dos2_QL_Win_Win_SMSQE332_WIN"): print fname$(#ch):close
rem Prints QL_Win_Win - Good!
ch=fop_dir("dos2_QL_Win_Win_SMSQE332_W"): print fname$(#ch):close
rem Prints QL_Win_Win - Good!
ch=fop_dir("dos2_QL_Win_Win_SMSQE332_"): print fname$(#ch):close
rem Prints QL_Win_Win - Good!
ch=fop_dir("dos2_QL_Win_Win_SMSQE332"): print fname$(#ch):close
rem Prints QL_Win_Win_SMSQE322 - Hmpf!
Qdos and co havent exactly provided us with any easy solutions to parsing
file names or reading directories (yes, I know: Qdos & co
device
drivers). Its pretty much peek and poke here, and each man
for himself! We could really do with a break here! Consistency, even
where things may be in that grey area of "not specified", would be a great
help - and much appreciated!
Goes without saying: IMHO!
PS: I started this before I saw your [mk79] response that it has been fixed!
Thank you very much for that! However, I'll let my message stand, as it
may shed some light on the issue for those less acquainted with
programming under Qdos & co.