|
|
bool open ( int mode ) |
Opens the tar file/data for reading or writing.
Parameters:
mode | may be IO_ReadOnly or IO_WriteOnly |
void close () |
Closes the tar file/data.
bool isOpened () |
Returns: true if the file is opened
void writeDir ( const QString& name, const QString& user, const QString& group ) |
If a tar file is opened for writing then you can add new directories using this function. KTar won't write one directory twice.
void writeFile ( const QString& name, const QString& user, const QString& group, uint size, const char* data ) |
If a tar file is opened for writing then you can add a new file using this function. If the file name is for example "mydir/test1" then the directory "mydir" is automatically appended first if that did not happen yet.
const KTarDirectory* directory () |
If a tar file is opened for reading, then the contents of the file can be accessed via this function.
int read ( char * buffer, int len ) |
Read len
data into buffer
- reimplemented
Returns: length read
void write ( const char * buffer, int len ) |
Write len
data from buffer
- reimplemented
int position () |
Returns: the current position - reimplemented
KTarDirectory * findOrCreate ( const QString & path ) |
@internal Ensure path exists, create otherwise. This handles tar files missing directory entries, like mico-2.3.0.tar.gz :)
void fillBuffer ( char * buffer, const char * mode, int size, char typeflag, const char * uname, const char * gname ) |
@internal
Fills buffer
for writing a file as required by the tar format
Has to be called LAST, since it does the checksum
(normally, only the name has to be filled in before)
Parameters:
mode | is expected to be 6 chars long, [uname and gname 31]. |