Questions on the new KIO::FileJob API

Allan Sandfeld Jensen kde at carewolf.com
Wed May 14 21:15:15 BST 2008


On Wednesday 14 May 2008, nf2 wrote:
> Allan Sandfeld Jensen wrote:
> > On Wednesday 07 May 2008, Vlad wrote:
> >>> 2) - Reading Files: From reading the code in kio_file i'm not sure
> >>> whether data() is supposed to emit all the requested data in a
> >>> single
> >>> callback
> >>
> >> Yes, one data() should emit all the requested data, unless the slave
> >> reaches EOF, in which case it returns all the data up to the EOF.
> >
> > No. A read can result in any number data() emits. For files it will
> > usually be only one, but for streams it can be multiple.
>
> Hmm ... i really don't understand why KIO has to behave unlike all the
> other IO interfaces here. Which use a "one call - one reply" schema (but
> sometimes reading/writing less than requested - to keep the operations
> "atomic"). Queuing up seek()s sounds pretty dodgy to me.
>
Well, it is not my prefered API, but it comes from the KIO background of only 
doing put and get, where you issue one get() and get multiple data() signals 
back. The FileJob API is just a small extension to that system.

`Allan




More information about the kde-core-devel mailing list