Page 1 of 1
Some WBRun arguments fail (Solved)
Posted: Tue Feb 23, 2016 12:07 am
by xenic
If you use an argument to WBRun that contains a colon ":" it results in a requester asking for a volume.
Enter a command like this in a shell to reproduce:
WBRun PROG Work:Odyssey/Odyssey ARGS
http://amigans.net
The result will be a requester asking for volume "http:". Adding quotes to the argument has no effect.
WBRun should just be passing arguments to the program and not trying to lock or open them itself.
Re: WBRun bug causing some arguments to fail
Posted: Tue Feb 23, 2016 3:23 am
by broadblues
If you invoke WBrun on a file ot directory it's te same as if you had double clicked on it on the workbench.
You cannot pass arguments to a workbench program, but you can multislect icons then double click on a prgram, and I think this is what ARGS provides the equivalent of.
If does not because it cannot pass the CLI argument string to the prgram, it doesn't make sense, there is not such thing on the workbench.
Re: WBRun bug causing some arguments to fail
Posted: Tue Feb 23, 2016 1:43 pm
by broadblues
PS WBrun is a thin wrapper to IWorkbench->OpenWorkbenchObject() so to understand more why WBRun locks the parent directory of any argument term passed take look at the autodoc for IWorkbench->OpenWorkbenchObject()
eg this example:
Code: Select all
// Launch the application "Paint" with the project files "Image1"
// and "Anim1", which are both found in the drawers "Paint:Pictures"
// and "Paint:Animations", respectively.
BPTR lock1 = Lock("Paint:Pictures",SHARED_LOCK);
BPTR lock2 = Lock("Paint:Animations",SHARED_LOCK);
if(lock1 && lock2)
{
if(!OpenWorkbenchObject("Paint",
WBOPENA_ArgLock, lock1,
WBOPENA_ArgName, "Image1",
WBOPENA_ArgLock, lock2,
WBOPENA_ArgName, "Anim1",
TAG_DONE))
{
PrintFault(IoErr(), NULL);
}
}
if (lock1)
Unlock(lock1);
if (lock2)
Unlock(lock2);
Re: WBRun bug causing some arguments to fail
Posted: Tue Feb 23, 2016 4:14 pm
by xenic
broadblues wrote:If you invoke WBrun on a file ot directory it's te same as if you had double clicked on it on the workbench.
You're right. I didn't think it through before reporting a problem. I removed "bug" from the topic title and marked it solved. Thanks for setting me straight.