27 $info = &$this->getid3->info;
29 $info[
'fileformat'] =
'tar';
32 $unpack_header =
'a100fname/a8mode/a8uid/a8gid/a12size/a12mtime/a8chksum/a1typflag/a100lnkname/a6magic/a2ver/a32uname/a32gname/a8devmaj/a8devmin/a155prefix';
33 $null_512k = str_repeat(
"\x00", 512);
36 while (!
feof($this->getid3->fp)) {
37 $buffer = $this->
fread(512);
38 if (strlen($buffer) < 512) {
44 for (
$i = 0;
$i < 148;
$i++) {
45 $checksum += ord($buffer{
$i});
47 for (
$i = 148;
$i < 156;
$i++) {
48 $checksum += ord(
' ');
50 for (
$i = 156;
$i < 512;
$i++) {
51 $checksum += ord($buffer{
$i});
53 $attr = unpack($unpack_header, $buffer);
54 $name = (isset($attr[
'fname'] ) ? trim($attr[
'fname'] ) :
'');
55 $mode = octdec(isset($attr[
'mode'] ) ? trim($attr[
'mode'] ) :
'');
56 $uid = octdec(isset($attr[
'uid'] ) ? trim($attr[
'uid'] ) :
'');
57 $gid = octdec(isset($attr[
'gid'] ) ? trim($attr[
'gid'] ) :
'');
58 $size = octdec(isset($attr[
'size'] ) ? trim($attr[
'size'] ) :
'');
59 $mtime = octdec(isset($attr[
'mtime'] ) ? trim($attr[
'mtime'] ) :
'');
60 $chksum = octdec(isset($attr[
'chksum'] ) ? trim($attr[
'chksum'] ) :
'');
61 $typflag = (isset($attr[
'typflag']) ? trim($attr[
'typflag']) :
'');
62 $lnkname = (isset($attr[
'lnkname']) ? trim($attr[
'lnkname']) :
'');
63 $magic = (isset($attr[
'magic'] ) ? trim($attr[
'magic'] ) :
'');
64 $ver = (isset($attr[
'ver'] ) ? trim($attr[
'ver'] ) :
'');
65 $uname = (isset($attr[
'uname'] ) ? trim($attr[
'uname'] ) :
'');
66 $gname = (isset($attr[
'gname'] ) ? trim($attr[
'gname'] ) :
'');
67 $devmaj = octdec(isset($attr[
'devmaj'] ) ? trim($attr[
'devmaj'] ) :
'');
68 $devmin = octdec(isset($attr[
'devmin'] ) ? trim($attr[
'devmin'] ) :
'');
69 $prefix = (isset($attr[
'prefix'] ) ? trim($attr[
'prefix'] ) :
'');
70 if (($checksum == 256) && ($chksum == 0)) {
80 if ($buffer == $null_512k) {
91 $this->
fseek((512 - $diff), SEEK_CUR);
100 'mode' => self::display_perms($mode),
106 'typeflag' => self::get_flag_type($typflag),
107 'linkname' => $lnkname,
112 'devmajor' => $devmaj,
113 'devminor' => $devmin
123 if ($mode & 0x1000)
$type=
'p';
124 elseif ($mode & 0x2000)
$type=
'c';
125 elseif ($mode & 0x4000)
$type=
'd';
126 elseif ($mode & 0x6000)
$type=
'b';
127 elseif ($mode & 0x8000)
$type=
'-';
128 elseif ($mode & 0xA000)
$type=
'l';
129 elseif ($mode & 0xC000)
$type=
's';
133 $owner[
'read'] = (($mode & 00400) ?
'r' :
'-');
134 $owner[
'write'] = (($mode & 00200) ?
'w' :
'-');
135 $owner[
'execute'] = (($mode & 00100) ?
'x' :
'-');
136 $group[
'read'] = (($mode & 00040) ?
'r' :
'-');
137 $group[
'write'] = (($mode & 00020) ?
'w' :
'-');
138 $group[
'execute'] = (($mode & 00010) ?
'x' :
'-');
139 $world[
'read'] = (($mode & 00004) ?
'r' :
'-');
140 $world[
'write'] = (($mode & 00002) ?
'w' :
'-');
141 $world[
'execute'] = (($mode & 00001) ?
'x' :
'-');
144 if ($mode & 0x800) $owner[
'execute'] = ($owner[
'execute'] ==
'x') ?
's' :
'S';
145 if ($mode & 0x400) $group[
'execute'] = ($group[
'execute'] ==
'x') ?
's' :
'S';
146 if ($mode & 0x200) $world[
'execute'] = ($world[
'execute'] ==
'x') ?
't' :
'T';
149 $s .= sprintf(
'%1s%1s%1s', $owner[
'read'], $owner[
'write'], $owner[
'execute']);
150 $s .= sprintf(
'%1s%1s%1s', $group[
'read'], $group[
'write'], $group[
'execute']);
151 $s .= sprintf(
'%1s%1s%1s'.
"\n", $world[
'read'], $world[
'write'], $world[
'execute']);
157 static $flag_types =
array(
167 'K' =>
'LF_LONGLINK',
168 'L' =>
'LF_LONGNAME',
169 'M' =>
'LF_MULTIVOL',
174 return (isset($flag_types[$typflag]) ? $flag_types[$typflag] :
'');
getID3() by James Heinrich info@getid3.org //
Create styles array
The data for the language used.
static array_merge_clobber($array1, $array2)
fseek($bytes, $whence=SEEK_SET)
static CreateDeepArray($ArrayPath, $Separator, $Value)