As we are talking about running from Workbench as a default tool, I doubt that ReadArgs has anything to do with it.
Workbench presents its argument to the app as wa_Lock and wa_Name pairs. wa_Lock is a BPTR lock to the directory and wa_Name is the name of the file.
So I assume Par$() in this case only uses the wa_Name part and under OS 2.0+ ParPath$() uses NameFromLock() and AddPart() to combine the directory name and the file name.
However, if there was a means to get access to the wa_Lock part, then you could use CurrentDir() to change the current diectory and then access the file using wa_Name. Then you wouldn't need to care about the directory name. Even better, DOS would assure that you enter exactly the right directory. If you first turn it into a name it could be misleading as there can be multiple volumes with the same name.
|