[Gambas-user] Fw: Shell with wait does not wait till work complettion

sundar j sundar_ima at ...251...
Mon May 21 21:33:25 CEST 2012


TextLabel.Text = "Copy in progress"

Shell "cp -r <src> <dst>" Wait
TextLabel.Text = "Completed."

I used above code in my application. Shell indicated that all files are being copied one-by-one. But TextLable did not display Copy in progress. I did lot of experiment with the above code. Finaly i got it working by adding time delay just before shell command. Now my code looks like this :-

TextLabel.Text = "Copy in progress"
wait 0.1

Shell "cp -r <src> <dst>" Wait

TextLabel.Text = "Completed."

I really have no clue  why code worked after inserting time delay. 

From: tobi <tobiasboege01 at ...1601...>
Sent: Mon, 21 May 2012 23:40:35 
To: sundar_ima at ...251..., mailing list for gambas users <gambas-user at lists.sourceforge.net>
Subject: Re: [Gambas-user] Shell with wait does not wait till work complettion
On Mon, 21 May 2012, sundar j wrote:

> In my application I need to copy folder content to other folder using shell cp command (since gambas does not support COPY recurse) with wait option. When copying is in progress TextLabel will indicate "Copy in Progress" .&nbsp; Once copying is complete then TextLable will indicate something else. For some reason wait option in shell command does nothing and I am not able to set the text&nbsp; "Copy in Progress" in TextLabel properly. Is it bug or am I missing some code?

> ------------------------------------------------------------------------------

> Live Security Virtual Conference

> Exclusive live event will cover all the ways today's security and 

> threat landscape has changed and how IT managers can respond. Discussions 

> will include endpoint security, mobile security and the latest in malware 

> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

> _______________________________________________

> Gambas-user mailing list

> Gambas-user at lists.sourceforge.net

> https://lists.sourceforge.net/lists/listinfo/gambas-user



What do you mean by "wait option [...] does nothing"? Does the shell give an error?

I assume that you have something like:



TextLabel.Text = "Copy in progress"

Shell "cp -r <src> <dst>" Wait



If I remember correctly, using this construct prevents the GUI from refreshing itself, so you won't

see anything until the command completes and a new event loop is entered?



I think one could help better with more information.



Regards,

Tobi



Follow Rediff Deal ho jaye! to get exciting offers in your city everyday.



More information about the User mailing list