FileJob Class Reference
from PyKDE4.kio import *
Inherits: KIO.SimpleJob → KIO.Job → KCompositeJob → KJob → QObject
Namespace: KIO.FileJob
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, KIO.filesize_t offset) | |
| redirection (, KIO.Job job, KUrl url) | |
| written (, KIO.Job job, KIO.filesize_t written) | |
Methods | |
| __init__ (self) | |
| close (self) | |
| close (self, KIO.Job job) | |
| data (self, KIO.Job job, QByteArray data) | |
| mimetype (self, KIO.Job job, QString type) | |
| open (self, KIO.Job job) | |
| position (self, KIO.Job job, KIO.filesize_t offset) | |
| read (self, KIO.filesize_t size) | |
| redirection (self, KIO.Job job, KUrl url) | |
| seek (self, KIO.filesize_t offset) | |
| KIO.filesize_t | size (self) |
| write (self, QByteArray data) | |
| written (self, KIO.Job job, KIO.filesize_t written) | |
Method Documentation
| __init__ | ( | self ) |
| close | ( | self ) |
File is closed and will accept no more commands
- Parameters:
-
job the job that emitted this signal
| close | ( | self, | ||
| 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 | ( | self, | ||
| 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 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 | ( | self, | ||
| 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 | ( | self, | ||
| KIO.Job | job, | |||
| KIO.filesize_t | 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)
| read | ( | self, | ||
| KIO.filesize_t | size | |||
| ) |
Read block
The slave emits the data through data().
- Parameters:
-
size the requested amount of data
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)
| seek | ( | self, | ||
| KIO.filesize_t | offset | |||
| ) |
Seek
The slave emits position()
- Parameters:
-
offset the position from start to go to
| KIO.filesize_t size | ( | self ) |
Size
- Returns:
- the file size
| write | ( | self, | ||
| QByteArray | data | |||
| ) |
Write block
- Parameters:
-
data the data to write
| written | ( | self, | ||
| KIO.Job | job, | |||
| KIO.filesize_t | 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)
KDE 4.4 PyKDE API Reference