<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US"> <head> <title>kio/kio: KTar Class Reference (kio/kio)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org" r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org" r (n 0 s 0 v 0 l 0))' /> <meta name="trademark" content="KDE e.V." /> <meta name="description" content="K Desktop Environment Homepage, KDE.org" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="robots" content="all" /> <link rel="shortcut icon" href="../../../favicon.ico" /> <link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" /> </head> <body> <div id="nav_header_top" align="right"> <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a> <a href="../../.."><img id="nav_header_logo" alt="Home" align="left" src="../../../kde_gear_64.png" border="0" /></a> <span class="doNotDisplay">::</span> <div id="nav_header_title" align="left">KDE API Reference</div> </div> <div id="nav_header_bottom" align="right"> <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span> <div id="nav_header_bottom_right" style="text-align: left;"> / <a href="../../..">API Reference</a> / <a href="../../html/index.html">kio</a> / <a href=".">kio</a> </div> </div> <table id="main" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" class="menuheader" height="0"></td> <td id="contentcolumn" valign="top" rowspan="2" > <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;"> <a name="content"></a> <!-- Generated by Doxygen 1.7.4 --> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> </div> <div class="headertitle"> <div class="title">KTar Class Reference</div> </div> </div> <div class="contents"> <!-- doxytag: class="KTar" --><!-- doxytag: inherits="KArchive" --> <p>A class for reading / writing (optionally compressed) tar archives. <a href="classKTar.html#details">More...</a></p> <p><code>#include <<a class="el" href="ktar_8h_source.html">ktar.h</a>></code></p> <div class="dynheader"> Inheritance diagram for KTar:</div> <div class="dyncontent"> <div class="center"> <img src="classKTar.png" usemap="#KTar_map" alt=""/> <map id="KTar_map" name="KTar_map"> <area href="classKArchive.html" title="KArchive is a base class for reading and writing archives." alt="KArchive" shape="rect" coords="0,0,65,24"/> </map> </div></div> <p><a href="classKTar-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a6870fb584d069eb8d7001d93565cfb22">KTar</a> (const <a class="elRef" href="qstring.html">QString</a> &filename, const <a class="elRef" href="qstring.html">QString</a> &mimetype=QString::null)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a93e7ce44e3438619e7cfb91bc879f688">KTar</a> (<a class="elRef" href="qiodevice.html">QIODevice</a> *dev)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a8388c1acf8491f32ea04a9bc298f2d36">~KTar</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a44968ffc5f2db8772bb22e5f0eb4162d">fileName</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#aee050c5380d7be797deb5bc4be44eadb">setOrigFileName</a> (const <a class="elRef" href="qcstring.html">QCString</a> &fileName)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a56609fd3b04acd74fc0b3bc5e015af1c">writeSymLink</a> (const <a class="elRef" href="qstring.html">QString</a> &name, const <a class="elRef" href="qstring.html">QString</a> &target, const <a class="elRef" href="qstring.html">QString</a> &user, const <a class="elRef" href="qstring.html">QString</a> &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a400a95909477dc244119cf205fa6f810">writeDir</a> (const <a class="elRef" href="qstring.html">QString</a> &name, const <a class="elRef" href="qstring.html">QString</a> &user, const <a class="elRef" href="qstring.html">QString</a> &group)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a4da59bfdb20847de10eddde558211076">writeDir</a> (const <a class="elRef" href="qstring.html">QString</a> &name, const <a class="elRef" href="qstring.html">QString</a> &user, const <a class="elRef" href="qstring.html">QString</a> &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#adae52467799ccc1cdfb096f1fb468633">prepareWriting</a> (const <a class="elRef" href="qstring.html">QString</a> &name, const <a class="elRef" href="qstring.html">QString</a> &user, const <a class="elRef" href="qstring.html">QString</a> &group, uint size)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a7821bca5ab5c0bb35220577ac5522727">prepareWriting</a> (const <a class="elRef" href="qstring.html">QString</a> &name, const <a class="elRef" href="qstring.html">QString</a> &user, const <a class="elRef" href="qstring.html">QString</a> &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a680c42d319226a5c517fa7ac77b939b6">doneWriting</a> (uint size)</td></tr> <tr><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a74a40c20818f148211d5480c79567d66">openArchive</a> (int mode)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classKTar.html#a9287a3f9a2dd56821559a7f87c078f9c">closeArchive</a> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c572845fec0e89c608f3b727dfd849c"></a><!-- doxytag: member="KTar::virtual_hook" ref="a2c572845fec0e89c608f3b727dfd849c" args="(int id, void *data)" --> virtual void </td><td class="memItemRight" valign="bottom"><b>virtual_hook</b> (int id, void *data)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9b5f4f54f2fd709ddf29be5a971c5e62"></a><!-- doxytag: member="KTar::prepareWriting_impl" ref="a9b5f4f54f2fd709ddf29be5a971c5e62" args="(const QString &name, const QString &user, const QString &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime)" --> bool </td><td class="memItemRight" valign="bottom"><b>prepareWriting_impl</b> (const <a class="elRef" href="qstring.html">QString</a> &name, const <a class="elRef" href="qstring.html">QString</a> &user, const <a class="elRef" href="qstring.html">QString</a> &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a91269c8347df31eef7f66feed229956e"></a><!-- doxytag: member="KTar::writeDir_impl" ref="a91269c8347df31eef7f66feed229956e" args="(const QString &name, const QString &user, const QString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)" --> bool </td><td class="memItemRight" valign="bottom"><b>writeDir_impl</b> (const <a class="elRef" href="qstring.html">QString</a> &name, const <a class="elRef" href="qstring.html">QString</a> &user, const <a class="elRef" href="qstring.html">QString</a> &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa66f7eda641e3e3929c4cbe848d0d534"></a><!-- doxytag: member="KTar::writeSymLink_impl" ref="aa66f7eda641e3e3929c4cbe848d0d534" args="(const QString &name, const QString &target, const QString &user, const QString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)" --> bool </td><td class="memItemRight" valign="bottom"><b>writeSymLink_impl</b> (const <a class="elRef" href="qstring.html">QString</a> &name, const <a class="elRef" href="qstring.html">QString</a> &target, const <a class="elRef" href="qstring.html">QString</a> &user, const <a class="elRef" href="qstring.html">QString</a> &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)</td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>A class for reading / writing (optionally compressed) tar archives. </p> <p><a class="el" href="classKTar.html" title="A class for reading / writing (optionally compressed) tar archives.">KTar</a> allows you to read and write tar archives, including those that are compressed using gzip or bzip2.</p> <dl class="author"><dt><b>Author:</b></dt><dd>Torben Weis <<a href="mailto:weis@kde.org">weis@kde.org</a>>, David Faure <<a href="mailto:faure@kde.org">faure@kde.org</a>> </dd></dl> <p>Definition at line <a class="el" href="ktar_8h_source.html#l00040">40</a> of file <a class="el" href="ktar_8h_source.html">ktar.h</a>.</p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a6870fb584d069eb8d7001d93565cfb22"></a><!-- doxytag: member="KTar::KTar" ref="a6870fb584d069eb8d7001d93565cfb22" args="(const QString &filename, const QString &mimetype=QString::null)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">KTar::KTar </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>filename</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>mimetype</em> = <code>QString::null</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates an instance that operates on the given filename using the compression filter associated to given mimetype. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">filename</td><td>is a local path (e.g. "/home/weis/myfile.tgz") </td></tr> <tr><td class="paramname">mimetype</td><td>"application/x-gzip" or "application/x-bzip2" Do not use application/x-tgz or similar - you only need to specify the compression layer ! If the mimetype is omitted, it will be determined from the filename. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00059">59</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="a93e7ce44e3438619e7cfb91bc879f688"></a><!-- doxytag: member="KTar::KTar" ref="a93e7ce44e3438619e7cfb91bc879f688" args="(QIODevice *dev)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">KTar::KTar </td> <td>(</td> <td class="paramtype"><a class="elRef" href="qiodevice.html">QIODevice</a> * </td> <td class="paramname"><em>dev</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Creates an instance that operates on the given device. </p> <p>The device can be compressed (<a class="el" href="classKFilterDev.html" title="A class for reading and writing compressed data onto a device (e.g.">KFilterDev</a>) or not (<a class="elRef" href="qfile.html">QFile</a>, etc.). </p> <dl class="warning"><dt><b>Warning:</b></dt><dd>Do not assume that giving a <a class="elRef" href="qfile.html">QFile</a> here will decompress the file, in case it's compressed! </dd></dl> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">dev</td><td>the device to read from. If the source is compressed, the <a class="elRef" href="qiodevice.html">QIODevice</a> must take care of decompression </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00142">142</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="a8388c1acf8491f32ea04a9bc298f2d36"></a><!-- doxytag: member="KTar::~KTar" ref="a8388c1acf8491f32ea04a9bc298f2d36" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">KTar::~KTar </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>If the tar ball is still opened, then it will be closed automatically by the destructor. </p> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00149">149</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a9287a3f9a2dd56821559a7f87c078f9c"></a><!-- doxytag: member="KTar::closeArchive" ref="a9287a3f9a2dd56821559a7f87c078f9c" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool KTar::closeArchive </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Closes the archive. </p> <p>Called by close. </p> <p>Implements <a class="el" href="classKArchive.html#a52fa0982c4acaf9dcca8df09749e99a0">KArchive</a>.</p> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00534">534</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="a680c42d319226a5c517fa7ac77b939b6"></a><!-- doxytag: member="KTar::doneWriting" ref="a680c42d319226a5c517fa7ac77b939b6" args="(uint size)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool KTar::doneWriting </td> <td>(</td> <td class="paramtype">uint </td> <td class="paramname"><em>size</em></td><td>)</td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Call doneWriting after writing the data. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">size</td><td>the size of the file </td></tr> </table> </dd> </dl> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classKTar.html#adae52467799ccc1cdfb096f1fb468633" title="Here's another way of writing a file into an archive: Call prepareWriting, then call writeData() as m...">prepareWriting()</a> </dd></dl> <p>Implements <a class="el" href="classKArchive.html#aa25a334b408e743c4ac928597777a5d0">KArchive</a>.</p> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00617">617</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="a44968ffc5f2db8772bb22e5f0eb4162d"></a><!-- doxytag: member="KTar::fileName" ref="a44968ffc5f2db8772bb22e5f0eb4162d" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" href="qstring.html">QString</a> KTar::fileName </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>The name of the tar file, as passed to the constructor Null if you used the <a class="elRef" href="qiodevice.html">QIODevice</a> constructor. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>the name of the file, or QString::null if unknown </dd></dl> <p>Definition at line <a class="el" href="ktar_8h_source.html#l00076">76</a> of file <a class="el" href="ktar_8h_source.html">ktar.h</a>.</p> </div> </div> <a class="anchor" id="a74a40c20818f148211d5480c79567d66"></a><!-- doxytag: member="KTar::openArchive" ref="a74a40c20818f148211d5480c79567d66" args="(int mode)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool KTar::openArchive </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>mode</em></td><td>)</td> <td><code> [protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Opens the archive for reading. </p> <p>Parses the directory listing of the archive and creates the KArchiveDirectory/KArchiveFile entries. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">mode</td><td>the mode of the file </td></tr> </table> </dd> </dl> <p>Implements <a class="el" href="classKArchive.html#aa31f2331fa3be7abe14811eca7f2e54b">KArchive</a>.</p> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00330">330</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="adae52467799ccc1cdfb096f1fb468633"></a><!-- doxytag: member="KTar::prepareWriting" ref="adae52467799ccc1cdfb096f1fb468633" args="(const QString &name, const QString &user, const QString &group, uint size)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool KTar::prepareWriting </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>group</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint </td> <td class="paramname"><em>size</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Here's another way of writing a file into an archive: Call prepareWriting, then call <a class="el" href="classKArchive.html#ac6cc6eb9cf66e19de86fc8b7631a35f3" title="Write data into the current file - to be called after calling prepareWriting.">writeData()</a> as many times as wanted then call doneWriting( totalSize ). </p> <p>For tar.gz files, you need to know the size before hand, since it is needed in the header. For zip files, size isn't used.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>the name of the file </td></tr> <tr><td class="paramname">user</td><td>the user that owns the file </td></tr> <tr><td class="paramname">group</td><td>the group that owns the file </td></tr> <tr><td class="paramname">size</td><td>the size of the file</td></tr> </table> </dd> </dl> <dl class="todo"><dt><b><a class="el" href="todo.html#_todo000006">Todo:</a></b></dt><dd>TODO(BIC): make this a thin non-virtual wrapper around prepareWriting(name,user,group,size,perm,atime,mtime,ctime) or eliminate it. </dd></dl> <p>Implements <a class="el" href="classKArchive.html#a60b42cc93e203295157d6cff896dc225">KArchive</a>.</p> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00609">609</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="a7821bca5ab5c0bb35220577ac5522727"></a><!-- doxytag: member="KTar::prepareWriting" ref="a7821bca5ab5c0bb35220577ac5522727" args="(const QString &name, const QString &user, const QString &group, uint size, mode_t perm, time_t atime, time_t mtime, time_t ctime)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool KTar::prepareWriting </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>group</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint </td> <td class="paramname"><em>size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">mode_t </td> <td class="paramname"><em>perm</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">time_t </td> <td class="paramname"><em>atime</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">time_t </td> <td class="paramname"><em>mtime</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">time_t </td> <td class="paramname"><em>ctime</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Here's another way of writing a file into an archive: Call prepareWriting, then call <a class="el" href="classKArchive.html#ac6cc6eb9cf66e19de86fc8b7631a35f3" title="Write data into the current file - to be called after calling prepareWriting.">writeData()</a> as many times as wanted then call doneWriting( totalSize ). </p> <p>For tar.gz files, you need to know the size before hand, it is needed in the header! For zip files, size isn't used.</p> <p>This method also allows some file metadata to be set. However, depending on the archive type not all metadata might be regarded. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>the name of the file </td></tr> <tr><td class="paramname">user</td><td>the user that owns the file </td></tr> <tr><td class="paramname">group</td><td>the group that owns the file </td></tr> <tr><td class="paramname">size</td><td>the size of the file </td></tr> <tr><td class="paramname">perm</td><td>permissions of the file </td></tr> <tr><td class="paramname">atime</td><td>time the file was last accessed </td></tr> <tr><td class="paramname">mtime</td><td>modification time of the file </td></tr> <tr><td class="paramname">ctime</td><td>creation time of the file </td></tr> </table> </dd> </dl> <dl class="since"><dt><b>Since:</b></dt><dd>3.2 </dd></dl> <dl class="todo"><dt><b><a class="el" href="todo.html#_todo000007">Todo:</a></b></dt><dd>TODO(BIC): make this virtual. For now use virtual hook. </dd></dl> <p>Reimplemented from <a class="el" href="classKArchive.html#a2a44d91c957af94cd80111df993d022a">KArchive</a>.</p> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00740">740</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="aee050c5380d7be797deb5bc4be44eadb"></a><!-- doxytag: member="KTar::setOrigFileName" ref="aee050c5380d7be797deb5bc4be44eadb" args="(const QCString &fileName)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void KTar::setOrigFileName </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qcstring.html">QCString</a> & </td> <td class="paramname"><em>fileName</em></td><td>)</td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Special function for setting the "original file name" in the gzip header, when writing a tar.gz file. </p> <p>It appears when using in the "file" command, for instance. Should only be called if the underlying device is a KFilterDev! </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">fileName</td><td>the original file name </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00164">164</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="a400a95909477dc244119cf205fa6f810"></a><!-- doxytag: member="KTar::writeDir" ref="a400a95909477dc244119cf205fa6f810" args="(const QString &name, const QString &user, const QString &group)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool KTar::writeDir </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>group</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>If an archive is opened for writing then you can add new directories using this function. </p> <p><a class="el" href="classKArchive.html" title="KArchive is a base class for reading and writing archives.">KArchive</a> won't write one directory twice.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>the name of the directory </td></tr> <tr><td class="paramname">user</td><td>the user that owns the directory </td></tr> <tr><td class="paramname">group</td><td>the group that owns the directory</td></tr> </table> </dd> </dl> <dl class="todo"><dt><b><a class="el" href="todo.html#_todo000001">Todo:</a></b></dt><dd>TODO(BIC): make this a thin wrapper around writeDir(name,user,group,perm,atime,mtime,ctime) or eliminate it </dd></dl> <p>Implements <a class="el" href="classKArchive.html#ae8a68fbcdc1daa3a125b5899676cecc1">KArchive</a>.</p> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00547">547</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="a4da59bfdb20847de10eddde558211076"></a><!-- doxytag: member="KTar::writeDir" ref="a4da59bfdb20847de10eddde558211076" args="(const QString &name, const QString &user, const QString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool KTar::writeDir </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>group</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">mode_t </td> <td class="paramname"><em>perm</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">time_t </td> <td class="paramname"><em>atime</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">time_t </td> <td class="paramname"><em>mtime</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">time_t </td> <td class="paramname"><em>ctime</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>If an archive is opened for writing then you can add new directories using this function. </p> <p><a class="el" href="classKArchive.html" title="KArchive is a base class for reading and writing archives.">KArchive</a> won't write one directory twice.</p> <p>This method also allows some file metadata to be set. However, depending on the archive type not all metadata might be regarded. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>the name of the directory </td></tr> <tr><td class="paramname">user</td><td>the user that owns the directory </td></tr> <tr><td class="paramname">group</td><td>the group that owns the directory </td></tr> <tr><td class="paramname">perm</td><td>permissions of the directory </td></tr> <tr><td class="paramname">atime</td><td>time the file was last accessed </td></tr> <tr><td class="paramname">mtime</td><td>modification time of the file </td></tr> <tr><td class="paramname">ctime</td><td>creation time of the file </td></tr> </table> </dd> </dl> <dl class="since"><dt><b>Since:</b></dt><dd>3.2 </dd></dl> <dl class="todo"><dt><b><a class="el" href="todo.html#_todo000002">Todo:</a></b></dt><dd>TODO(BIC): make this virtual. For now use virtual hook </dd></dl> <p>Reimplemented from <a class="el" href="classKArchive.html#a34c27e0aa9dc810ba1d5771f504162b3">KArchive</a>.</p> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00811">811</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <a class="anchor" id="a56609fd3b04acd74fc0b3bc5e015af1c"></a><!-- doxytag: member="KTar::writeSymLink" ref="a56609fd3b04acd74fc0b3bc5e015af1c" args="(const QString &name, const QString &target, const QString &user, const QString &group, mode_t perm, time_t atime, time_t mtime, time_t ctime)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool KTar::writeSymLink </td> <td>(</td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>target</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>user</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> & </td> <td class="paramname"><em>group</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">mode_t </td> <td class="paramname"><em>perm</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">time_t </td> <td class="paramname"><em>atime</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">time_t </td> <td class="paramname"><em>mtime</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">time_t </td> <td class="paramname"><em>ctime</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Writes a symbolic link to the archive if the archive must be opened for writing. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of symbolic link </td></tr> <tr><td class="paramname">target</td><td>target of symbolic link </td></tr> <tr><td class="paramname">user</td><td>the user that owns the directory </td></tr> <tr><td class="paramname">group</td><td>the group that owns the directory </td></tr> <tr><td class="paramname">perm</td><td>permissions of the directory </td></tr> <tr><td class="paramname">atime</td><td>time the file was last accessed </td></tr> <tr><td class="paramname">mtime</td><td>modification time of the file </td></tr> <tr><td class="paramname">ctime</td><td>creation time of the file </td></tr> </table> </dd> </dl> <dl class="since"><dt><b>Since:</b></dt><dd>3.2 </dd></dl> <dl class="todo"><dt><b><a class="el" href="todo.html#_todo000003">Todo:</a></b></dt><dd>TODO(BIC) make virtual. For now it must be implemented by virtual_hook. </dd></dl> <p>Reimplemented from <a class="el" href="classKArchive.html#a3798b8058f9f0639a2102e12722c95bb">KArchive</a>.</p> <p>Definition at line <a class="el" href="ktar_8cpp_source.html#l00874">874</a> of file <a class="el" href="ktar_8cpp_source.html">ktar.cpp</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="ktar_8h_source.html">ktar.h</a></li> <li><a class="el" href="ktar_8cpp_source.html">ktar.cpp</a></li> </ul> </div> </div></div> </td> </tr> <tr> <td valign="top" id="leftmenu" width="25%"> <a name="navigation"></a> <div class="menu_box"><h2>kio/kio</h2> <div class="nav_list"> <ul><li><a href="index.html">Main Page</a></li><li><a href="modules.html">Modules</a></li><li><a href="namespaces.html">Namespace List</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="namespacemembers.html">Namespace Members</a></li><li><a href="functions.html">Class Members</a></li><li><a href="pages.html">Related Pages</a></li></ul> <!-- <h2>Class Picker</h2> <div style="text-align: center;"> <form name="guideform"> <select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value"> <option value="annotated.html">-- Choose --</option> <option value="classKACL.html">kacl</option>, <option value="classKAr.html">kar</option>, <option value="classKArchive.html">karchive</option>, <option value="classKArchiveDirectory.html">karchivedirectory</option>, <option value="classKArchiveEntry.html">karchiveentry</option>, <option value="classKArchiveFile.html">karchivefile</option>, <option value="classKAutoMount.html">kautomount</option>, <option value="classKAutoUnmount.html">kautounmount</option>, <option value="classKDataTool.html">kdatatool</option>, <option value="classKDataToolAction.html">kdatatoolaction</option>, <option value="classKDataToolInfo.html">kdatatoolinfo</option>, <option value="classKDCOPServiceStarter.html">kdcopservicestarter</option>, <option value="classKDEDesktopMimeType.html">kdedesktopmimetype</option>, <option value="classKDirLister.html">kdirlister</option>, <option value="classKDirNotify.html">kdirnotify</option>, <option value="classKDirWatch.html">kdirwatch</option>, <option value="classKEMailSettings.html">kemailsettings</option>, <option value="classKExecMimeType.html">kexecmimetype</option>, <option value="classKFileFilter.html">kfilefilter</option>, <option value="classKFileItem.html">kfileitem</option>, <option value="classKFileMetaInfo.html">kfilemetainfo</option>, <option value="classKFileMetaInfoGroup.html">kfilemetainfogroup</option>, <option value="classKFileMetaInfoItem.html">kfilemetainfoitem</option>, <option value="classKFileMimeTypeInfo.html">kfilemimetypeinfo</option>, <option value="classKFileMimeTypeInfo_1_1GroupInfo.html">kfilemimetypeinfo::groupinfo</option>, <option value="classKFileMimeTypeInfo_1_1ItemInfo.html">kfilemimetypeinfo::iteminfo</option>, <option value="classKFilePlugin.html">kfileplugin</option>, <option value="classKFileShare.html">kfileshare</option>, <option value="classKFilterBase.html">kfilterbase</option>, <option value="classKFilterDev.html">kfilterdev</option>, <option value="classKFolderType.html">kfoldertype</option>, <option value="classKImageIO.html">kimageio</option>, <option value="classKIO_1_1AuthInfo.html">kio::authinfo</option>, <option value="classKIO_1_1ChmodJob.html">kio::chmodjob</option>, <option value="classKIO_1_1Connection.html">kio::connection</option>, <option value="classKIO_1_1CopyJob.html">kio::copyjob</option>, <option value="classKIO_1_1DataProtocol.html">kio::dataprotocol</option>, <option value="classKIO_1_1DataSlave.html">kio::dataslave</option>, <option value="classKIO_1_1DavJob.html">kio::davjob</option>, <option value="classKIO_1_1DeleteJob.html">kio::deletejob</option>, <option value="classKIO_1_1FileCopyJob.html">kio::filecopyjob</option>, <option value="classKIO_1_1ForwardingSlaveBase.html">kio::forwardingslavebase</option>, <option value="classKIO_1_1Job.html">kio::job</option>, <option value="classKIO_1_1ListJob.html">kio::listjob</option>, <option value="classKIO_1_1MetaData.html">kio::metadata</option>, <option value="classKIO_1_1MetaInfoJob.html">kio::metainfojob</option>, <option value="classKIO_1_1MimetypeJob.html">kio::mimetypejob</option>, <option value="classKIO_1_1MkdirJob.html">kio::mkdirjob</option>, <option value="classKIO_1_1MultiGetJob.html">kio::multigetjob</option>, <option value="classKIO_1_1NetAccess.html">kio::netaccess</option>, <option value="classKIO_1_1NetRC.html">kio::netrc</option>, <option value="classKIO_1_1PasswordDialog.html">kio::passworddialog</option>, <option value="classKIO_1_1PreviewJob.html">kio::previewjob</option>, <option value="classKIO_1_1ProgressBase.html">kio::progressbase</option>, <option value="classKIO_1_1RenameDlg.html">kio::renamedlg</option>, <option value="classKIO_1_1Scheduler.html">kio::scheduler</option>, <option value="classKIO_1_1SimpleJob.html">kio::simplejob</option>, <option value="classKIO_1_1Slave.html">kio::slave</option>, <option value="classKIO_1_1SlaveBase.html">kio::slavebase</option>, <option value="classKIO_1_1SlaveConfig.html">kio::slaveconfig</option>, <option value="classKIO_1_1SlaveInterface.html">kio::slaveinterface</option>, <option value="classKIO_1_1StatJob.html">kio::statjob</option>, <option value="classKIO_1_1StatusbarProgress.html">kio::statusbarprogress</option>, <option value="classKIO_1_1StoredTransferJob.html">kio::storedtransferjob</option>, <option value="classKIO_1_1TCPSlaveBase.html">kio::tcpslavebase</option>, <option value="classKIO_1_1TransferJob.html">kio::transferjob</option>, <option value="classKLimitedIODevice.html">klimitediodevice</option>, <option value="classKMimeMagic.html">kmimemagic</option>, <option value="classKMimeMagicResult.html">kmimemagicresult</option>, <option value="classKMimeType.html">kmimetype</option>, <option value="classKMimeTypeChooser.html">kmimetypechooser</option>, <option value="classKMimeTypeChooserDialog.html">kmimetypechooserdialog</option>, <option value="classKMimeTypeResolver.html">kmimetyperesolver</option>, <option value="classKNFSShare.html">knfsshare</option>, <option value="classKOCRDialog.html">kocrdialog</option>, <option value="classKOCRDialogFactory.html">kocrdialogfactory</option>, <option value="classKOpenWithHandler.html">kopenwithhandler</option>, <option value="classKProtocolInfo.html">kprotocolinfo</option>, <option value="classKProtocolManager.html">kprotocolmanager</option>, <option value="classKRemoteEncoding.html">kremoteencoding</option>, <option value="classKRun.html">krun</option>, <option value="classKSambaShare.html">ksambashare</option>, <option value="classKScanDialog.html">kscandialog</option>, <option value="classKScanDialogFactory.html">kscandialogfactory</option>, <option value="classKService.html">kservice</option>, <option value="classKServiceGroup.html">kservicegroup</option>, <option value="classKServiceOffer.html">kserviceoffer</option>, <option value="classKServiceType.html">kservicetype</option>, <option value="classKServiceTypeProfile.html">kservicetypeprofile</option>, <option value="classKShellCompletion.html">kshellcompletion</option>, <option value="classKShred.html">kshred</option>, <option value="classKSimpleFileFilter.html">ksimplefilefilter</option>, <option value="classKTar.html">ktar</option>, <option value="classKTrader.html">ktrader</option>, <option value="classKURIFilter.html">kurifilter</option>, <option value="classKURIFilterData.html">kurifilterdata</option>, <option value="classKURIFilterPlugin.html">kurifilterplugin</option>, <option value="classKURIFilterPluginList.html">kurifilterpluginlist</option>, <option value="classKURLCompletion.html">kurlcompletion</option>, <option value="classKURLPixmapProvider.html">kurlpixmapprovider</option>, <option value="classKZip.html">kzip</option>, <option value="classObserver.html">observer</option>, <option value="classRenameDlgPlugin.html">renamedlgplugin</option>, <option value="classThumbCreator.html">thumbcreator</option>, </select> </form> </div> --> </div></div> <div class="menu_box"><h2>API Dox</h2> <div class="nav_list"> <ul> <li><a href="../../../arts/html/index.html">arts</a></li><li><a href="../../../dcop/html/index.html">dcop</a></li><li><a href="../../../dnssd/html/index.html">dnssd</a></li><li><a href="../../../interfaces/html/index.html">interfaces</a></li><li> <a href="../../../interfaces/kimproxy/interface/html/index.html">interface</a></li><li> <a href="../../../interfaces/kimproxy/library/html/index.html">library</a></li><li> <a href="../../../interfaces/kspeech/html/index.html">kspeech</a></li><li> <a href="../../../interfaces/ktexteditor/html/index.html">ktexteditor</a></li><li><a href="../../../kabc/html/index.html">kabc</a></li><li><a href="../../../kate/html/index.html">kate</a></li><li><a href="../../../kcmshell/html/index.html">kcmshell</a></li><li><a href="../../../kdecore/html/index.html">kdecore</a></li><li><a href="../../../kded/html/index.html">kded</a></li><li><a href="../../../kdefx/html/index.html">kdefx</a></li><li><a href="../../../kdeprint/html/index.html">kdeprint</a></li><li><a href="../../../kdesu/html/index.html">kdesu</a></li><li><a href="../../../kdeui/html/index.html">kdeui</a></li><li><a href="../../../kdoctools/html/index.html">kdoctools</a></li><li><a href="../../../khtml/html/index.html">khtml</a></li><li><a href="../../../kimgio/html/index.html">kimgio</a></li><li><a href="../../../kinit/html/index.html">kinit</a></li><li><a href="../../../kio/html/index.html">kio</a></li><li> <a href="../../../kio/bookmarks/html/index.html">bookmarks</a></li><li> <a href="../../../kio/httpfilter/html/index.html">httpfilter</a></li><li> <a href="../../../kio/kfile/html/index.html">kfile</a></li><li> <a href="../../../kio/kio/html/index.html">kio</a></li><li> <a href="../../../kio/kioexec/html/index.html">kioexec</a></li><li> <a href="../../../kio/kpasswdserver/html/index.html">kpasswdserver</a></li><li> <a href="../../../kio/kssl/html/index.html">kssl</a></li><li><a href="../../../kioslave/html/index.html">kioslave</a></li><li> <a href="../../../kioslave/http/html/index.html">http</a></li><li><a href="../../../kjs/html/index.html">kjs</a></li><li><a href="../../../kmdi/html/index.html">kmdi</a></li><li> <a href="../../../kmdi/kmdi/html/index.html">kmdi</a></li><li><a href="../../../knewstuff/html/index.html">knewstuff</a></li><li><a href="../../../kparts/html/index.html">kparts</a></li><li><a href="../../../kresources/html/index.html">kresources</a></li><li><a href="../../../kspell2/html/index.html">kspell2</a></li><li><a href="../../../kunittest/html/index.html">kunittest</a></li><li><a href="../../../kutils/html/index.html">kutils</a></li><li><a href="../../../kwallet/html/index.html">kwallet</a></li><li><a href="../../../libkmid/html/index.html">libkmid</a></li><li><a href="../../../libkscreensaver/html/index.html">libkscreensaver</a></li> </ul></div></div> </td> </tr> </table> <span class="doNotDisplay"> <a href="http://www.kde.org/" accesskey="8">KDE Home</a> | <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> | <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a> </span> <div style="height: 8px"></div> <div id="footer"> <div id="footer_left"> Maintained by <a href="mailto:groot@kde.org">Adriaan de Groot</a> and <a href="mailto:winter@kde.org">Allen Winter</a>. <br/> KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> | <a href="http://www.kde.org/contact/impressum.php">Legal</a> </div> <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div> </div> <!-- WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL BE BLOCKED INSTANTLY AND PERMANENTLY! <a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a> WARNING END --> </body> </html>