#include <XrdOssArcZipFile.hh>
Definition at line 45 of file XrdOssArcZipFile.hh.
◆ XrdOssArcZipFile()
| XrdOssArcZipFile::XrdOssArcZipFile |
( |
const char * |
path, |
|
|
int & |
rc |
|
) |
| |
Definition at line 60 of file XrdOssArcZipFile.cc.
67 if ((zFD = XrdSysFD_Open(path, O_RDONLY)) < 0)
75 if (
fstat(zFD, &zFStat)) memset(&zFStat, 0,
sizeof(zFStat));
83 if ((zFile = zip_fdopen(zFD, ZIP_CHECKCONS, &zrc)) == 0)
84 {rc = zip2syserr(
"fdopen", zrc);
References close, and fstat.
◆ ~XrdOssArcZipFile()
| XrdOssArcZipFile::~XrdOssArcZipFile |
( |
| ) |
|
Definition at line 94 of file XrdOssArcZipFile.cc.
98 if (zSubFile)
Close();
103 {
if (zip_close(zFile))
104 {zipEmsg(
"close", zip_get_error(zFile));
112 if (zPath) free(zPath);
References XrdCl::Close().
◆ Close()
| int XrdOssArcZipFile::Close |
( |
| ) |
|
Definition at line 119 of file XrdOssArcZipFile.cc.
126 {
if ((zrc = zip_fclose(zSubFile))) zrc = zip2syserr(
"close member", zrc);
132 if (zMember) {free(zMember); zMember = 0;}
◆ Open()
| int XrdOssArcZipFile::Open |
( |
const char * |
member | ) |
|
Definition at line 143 of file XrdOssArcZipFile.cc.
149 if (zFile == 0)
return -EBADF;
154 {
if ((rc = zip_fclose(zSubFile))) zip2syserr(
"close", rc,
true);
162 if (zMember) free(zMember);
163 zMember = strdup(member);
167 zSubFile = zip_fopen(zFile, zMember, 0);
168 if (zSubFile == 0)
return zip2syserr(
"open", zip_get_error(zFile));
◆ Read()
| ssize_t XrdOssArcZipFile::Read |
( |
void * |
buff, |
|
|
off_t |
offset, |
|
|
size_t |
blen |
|
) |
| |
Definition at line 188 of file XrdOssArcZipFile.cc.
192 if (zSubFile == 0)
return -EBADF;
197 if (offset != zOffset)
198 {
if (!zSeek)
return -ESPIPE;
199 if (zip_fseek(zSubFile, offset, SEEK_SET))
200 return zip2syserr(
"seek into", zip_file_get_error(zSubFile));
210 zip_int64_t ret = zip_fread(zSubFile, buff, blen);
212 return zip2syserr(
"read", zip_file_get_error(zSubFile));
217 if (ret < (zip_int64_t)blen) zEOF =
true;
◆ Stat() [1/2]
| int XrdOssArcZipFile::Stat |
( |
const char * |
mName, |
|
|
struct stat & |
buf |
|
) |
| |
Definition at line 258 of file XrdOssArcZipFile.cc.
264 memcpy(&buf, &zFStat,
sizeof(
struct stat));
268 zip_stat_init(&zStat);
272 if (zip_stat(zFile, mName, 0, &zStat) < 0)
273 return zip2syserr(
"stat", zip_get_error(zFile));
277 if (zStat.valid & ZIP_STAT_INDEX) buf.st_ino = zStat.index;
278 if (zStat.valid & ZIP_STAT_SIZE) buf.st_size = zStat.size;
References stat.
◆ Stat() [2/2]
| int XrdOssArcZipFile::Stat |
( |
struct stat & |
buf | ) |
|
Definition at line 225 of file XrdOssArcZipFile.cc.
231 if (zSubFile == 0)
return -EBADF;
235 memcpy(&buf, &zFStat,
sizeof(
struct stat));
239 zip_stat_init(&zStat);
243 if (zip_stat(zFile, zMember, 0, &zStat) < 0)
244 return zip2syserr(
"stat", zip_get_error(zFile));
248 if (zStat.valid & ZIP_STAT_INDEX) buf.st_ino = zStat.index;
249 if (zStat.valid & ZIP_STAT_SIZE) buf.st_size = zStat.size;
References stat.
The documentation for this class was generated from the following files: