Finding where a file is...
Rick Murray (539) 13851 posts |
Is there a call that, when given a filespec, will output a fully qualified path? I had thought that the Canonicalise call in OS_FSControl would work, and indeed it does: DIM path% 255 SYS "OS_FSControl", 37, "fileinlib", path%, "Run$Path", 0, 256 SYS "XOS_GenerateError", path% TO path$ PRINT path$ returns, correctly, “SDFS::RISCOSPi.$.!BOOT.Library.fileinlib”. However, specifying “$.fileinroot” to the SWI returns the rather ridiculous filespec “SDFS#:SDFS::RISCOSpi.$.Coding.AcornC/C++.Libraries.DeskLib.!DLSources.Bin.$.fileinroot”! Is there a SWI that can do this? Should I simply try it without Run$Path, then with, and see which one arrives at a valid file? |
Tristan M. (2946) 1039 posts |
While not much help, it’s either the find utility that comes with DDE or the throwback window that spits out pathnames with different capitalisation. |
Rick Murray (539) 13851 posts |
I’m trying to replicate how the command line locates a command given to it… |
Tristan M. (2946) 1039 posts |
I’m just saying that there’s something floating around in RO that messes with capitalisation. |
Steve Pampling (1551) 8172 posts |
Probably some MS Office code that got lost. |
Timothy Baldwin (184) 242 posts |
I find OS_FSControl works in as your example if the target file actually exists, and fails as shown if the file doesn’t exist. The first instance ot the filesystem name is the selected filesystem, the second is from the path variable. |