FileJob Class Reference
from PyKDE4.kio import *
Inherits: KIO.SimpleJob → KIO.Job → KCompositeJob → KJob → QObject
Namespace: KIO
Detailed Description
The file-job is an asynchronious version of normal file handling. It allows block-wise reading and writing, and allows seeking. Results are returned through signals.
Should always be created using KIO.open(KUrl&)
Signals | |
close (KIO.Job job) | |
data (KIO.Job job, QByteArray data) | |
mimetype (KIO.Job job, QString type) | |
open (KIO.Job job) | |
position (KIO.Job job, long offset) | |
redirection (KIO.Job job, KUrl url) | |
written (KIO.Job job, long written) | |
Methods | |
__init__ (self) | |
close (self) | |
read (self, long size) | |
seek (self, long offset) | |
long | size (self) |
write (self, QByteArray data) |
Signal Documentation
close | ( | KIO.Job | job | |
) |
File is closed and will accept no more commands
- Parameters:
-
job the job that emitted this signal
- Signal syntax:
QObject.connect(source, SIGNAL("close(KIO::Job*)"), target_slot)
data | ( | KIO.Job | job, | |
QByteArray | data | |||
) |
Data from the slave has arrived.
- Parameters:
-
job the job that emitted this signal data data received from the slave.
- Signal syntax:
QObject.connect(source, SIGNAL("data(KIO::Job*, const QByteArray&)"), target_slot)
mimetype | ( | KIO.Job | job, | |
QString | type | |||
) |
Mimetype determined.
- Parameters:
-
job the job that emitted this signal type the mime type
- Signal syntax:
QObject.connect(source, SIGNAL("mimetype(KIO::Job*, const QString&)"), target_slot)
open | ( | KIO.Job | job | |
) |
File is open, metadata has been determined and the file-slave is ready to receive commands.
- Parameters:
-
job the job that emitted this signal
- Signal syntax:
QObject.connect(source, SIGNAL("open(KIO::Job*)"), target_slot)
position | ( | KIO.Job | job, | |
long | offset | |||
) |
The file has reached this position. Emitted after seek.
- Parameters:
-
job the job that emitted this signal offset the new position
- Signal syntax:
QObject.connect(source, SIGNAL("position(KIO::Job*, KIO::filesize_t)"), target_slot)
Signals the file is a redirection. Follow this url manually to reach data
- Parameters:
-
job the job that emitted this signal url the new URL
- Signal syntax:
QObject.connect(source, SIGNAL("redirection(KIO::Job*, const KUrl&)"), target_slot)
written | ( | KIO.Job | job, | |
long | written | |||
) |
Bytes written to the file.
- Parameters:
-
job the job that emitted this signal written bytes written.
- Signal syntax:
QObject.connect(source, SIGNAL("written(KIO::Job*, KIO::filesize_t)"), target_slot)
Method Documentation
__init__ | ( | self ) |
close | ( | self ) |
File is closed and will accept no more commands
- Parameters:
-
job the job that emitted this signal
read | ( | self, | ||
long | size | |||
) |
Read block
The slave emits the data through data().
- Parameters:
-
size the requested amount of data
seek | ( | self, | ||
long | offset | |||
) |
Seek
The slave emits position()
- Parameters:
-
offset the position from start to go to
long size | ( | self ) |
Size
- Returns:
- the file size
write | ( | self, | ||
QByteArray | data | |||
) |
Write block
- Parameters:
-
data the data to write