~ubuntu-branches/ubuntu/quantal/libarchive/quantal

« back to all changes in this revision

Viewing changes to doc/wiki/ManPageArchiveReadDisk3.wiki

  • Committer: Package Import Robot
  • Author(s): Andres Mejia
  • Date: 2012-02-23 19:29:24 UTC
  • mfrom: (8.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120223192924-73n4iedok5fwgsyr
Tags: 3.0.3-5
* Detect if locales or locales-all is installed for use with test suite.
* Bump Standards-Version to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#summary archive_read_disk 3 manual page
 
1
#summary ARCHIVE_READ_DISK 3 manual page
2
2
== NAME ==
3
3
*archive_read_disk_new*,
4
4
*archive_read_disk_set_symlink_logical*,
11
11
*archive_read_disk_set_gname_lookup*,
12
12
*archive_read_disk_set_standard_lookup*,
13
13
*archive_read_close*,
14
 
*archive_read_finish*
 
14
*archive_read_finish*,
 
15
*archive_read_free*
15
16
- functions for reading objects from disk
16
17
== SYNOPSIS ==
17
18
*#include <archive.h>*
63
64
*int*
64
65
<br>
65
66
*archive_read_finish*(_struct archive `*`_);
 
67
<br>
 
68
*int*
 
69
<br>
 
70
*archive_read_free*(_struct archive `*`_);
66
71
== DESCRIPTION ==
67
72
These functions provide an API for reading information about
68
73
objects on disk.
114
119
This convenience function installs a standard set of user
115
120
and group name lookup functions.
116
121
These functions use
117
 
*getpwid*(3)
 
122
*getpwuid*(3)
118
123
and
119
 
*getgrid*(3)
 
124
*getgrgid*(3)
120
125
to convert ids to names, defaulting to NULL if the names cannot
121
126
be looked up.
122
127
These functions also implement a simple memory cache to reduce
123
128
the number of calls to
124
 
*getpwid*(3)
 
129
*getpwuid*(3)
125
130
and
126
 
*getgrid*(3).
 
131
*getgrgid*(3).
127
132
</dd><dt>*archive_read_disk_entry_from_file*()</dt><dd>
128
133
Populates a
129
134
*struct archive_entry*
158
163
*struct archive_entry*
159
164
object.
160
165
</dd><dt>*archive_read_close*()</dt><dd>
161
 
This currently does nothing.
162
 
</dd><dt>*archive_write_finish*()</dt><dd>
 
166
Does nothing for
 
167
*archive_read_disk*
 
168
handles.
 
169
</dd><dt>*archive_read_finish*()</dt><dd>
 
170
This is a deprecated synonym for
 
171
*archive_read_free*().
 
172
</dd><dt>*archive_read_free*()</dt><dd>
163
173
Invokes
164
 
*archive_write_close*()
 
174
*archive_read_close*()
165
175
if it was not invoked manually, then releases all resources.
166
176
</dd></dl>
167
177
More information about the
187
197
  fd = open(name, O_RDONLY);
188
198
  if (fd < 0)
189
199
     return;
190
 
  archive_entry_copy_sourcepath(entry, name);
 
200
  archive_entry_copy_pathname(entry, name);
191
201
  archive_read_disk_entry_from_file(ard, entry, fd, NULL);
192
202
  archive_write_header(a, entry);
193
203
  while ((bytes_read = read(fd, buff, sizeof(buff))) > 0)
194
204
    archive_write_data(a, buff, bytes_read);
195
205
  archive_write_finish_entry(a);
196
 
  archive_read_finish(ard);
 
206
  archive_read_free(ard);
197
207
  archive_entry_free(entry);
198
208
}
199
209
}}}
209
219
for unusual conditions that do not prevent further operations, and
210
220
*ARCHIVE_FATAL*
211
221
for serious errors that make remaining operations impossible.
212
 
The
213
 
*archive_errno*(3)
214
 
and
215
 
*archive_error_string*(3)
216
 
functions can be used to retrieve an appropriate error code and a
217
 
textual error message.
218
 
(See
219
 
*archive_util*(3)
220
 
for details.)
221
222
 
222
223
*archive_read_disk_new*()
223
224
returns a pointer to a newly-allocated
233
234
The returned pointer points to internal storage that
234
235
may be reused on the next call to either of these functions;
235
236
callers should copy the string if they need to continue accessing it.
236
 
 
 
237
== ERRORS ==
 
238
Detailed error codes and textual descriptions are available from the
 
239
*archive_errno*()
 
240
and
 
241
*archive_error_string*()
 
242
functions.
237
243
== SEE ALSO ==
238
244
*archive_read*(3),
 
245
*archive_util*(3),
239
246
*archive_write*(3),
240
247
*archive_write_disk*(3),
241
248
*tar*(1),
255
262
The
256
263
*libarchive*
257
264
library was written by
258
 
Tim Kientzle  <kientzle@freebsd.org.>
 
265
Tim Kientzle  <kientzle@FreeBSD.org.>
259
266
== BUGS ==
260
267
The
261
268
"standard"
262
269
user name and group name lookup functions are not the defaults because
263
 
*getgrid*(3)
 
270
*getgrgid*(3)
264
271
and
265
 
*getpwid*(3)
 
272
*getpwuid*(3)
266
273
are sometimes too large for particular applications.
267
274
The current design allows the application author to use a more
268
275
compact implementation when appropriate.