kprocess/transferjob problem

Waldo Bastian bastian at kde.org
Sun Jul 6 16:19:25 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 06 July 2003 02:15, Alexander Neundorf wrote:
> Hi,
>
> I have the following problem: I get data froma transferjob and want to feed
> it into stdin of a kprocess. I tried to simply call process->writeStdin()
> whenever I get the data() signal from the job, but the writing doesn't
> always succeed, I guess the data comes faster than the kprocess consumes
> it. The simplest solution would be if the writing would be blocking.

You can use KProcIO which buffers the data to be written. This may be a very 
bad idea if you have a lot of data because you run the risk that you collect 
all the data in the buffer if the destination process is slow.

Another solution is to suspend the transferjob while you wait for the 
KProcess::wroteStdin signal. See TransferJob::suspend() / 
TransferJob::resume() 

Cheers,
Waldo
- -- 
bastian at kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/CD39N4pvrENfboIRAhxTAJ0eavEB1gyPtlvjXdqWBc9CWXsMXwCgi6YI
85VqNsOfZYhlSdmr+Zt0D7A=
=7pOg
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list