Some WBRun arguments fail (Solved)

A forum for general AmigaOS 4.x support questions that are not platform-specific
Post Reply
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Some WBRun arguments fail (Solved)

Post 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.
Last edited by xenic on Tue Feb 23, 2016 4:10 pm, edited 1 time in total.
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: WBRun bug causing some arguments to fail

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

Re: WBRun bug causing some arguments to fail

Post 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);
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: WBRun bug causing some arguments to fail

Post 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.
AmigaOne X1000 with 2GB memory - OS4.1 FE
Post Reply