Some WBRun arguments fail (Solved)

A forum for general AmigaOS 4.x support questions that are not platform-specific

Some WBRun arguments fail (Solved)

Postby xenic » Tue Feb 23, 2016 1:07 am

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.
Last edited by xenic on Tue Feb 23, 2016 5:10 pm, edited 1 time in total.
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1146
Joined: Sun Jun 19, 2011 1:06 am

Re: WBRun bug causing some arguments to fail

Postby broadblues » Tue Feb 23, 2016 4:23 am

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.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 538
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: WBRun bug causing some arguments to fail

Postby broadblues » Tue Feb 23, 2016 2:43 pm

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);
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 538
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: WBRun bug causing some arguments to fail

Postby xenic » Tue Feb 23, 2016 5:14 pm

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.
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1146
Joined: Sun Jun 19, 2011 1:06 am


Return to General AmigaOS

Who is online

Users browsing this forum: Google [Bot] and 7 guests