getFileSizeSyscall example

            $this->info['encoding']            = $this->encoding;   // required by id3v2 and iso modules - can be unset at the end if desired
            // option_max_2gb_check             if ($this->option_max_2gb_check) {
                // PHP (32-bit all, and 64-bit Windows) doesn't support integers larger than 2^31 (~2GB)                 // filesize() simply returns (filesize % (pow(2, 32)), no matter the actual filesize                 // ftell() returns 0 if seeking to the end is beyond the range of unsigned integer                 $fseek = fseek($this->fp, 0, SEEK_END);
                if (($fseek < 0) || (($this->info['filesize'] != 0) && (ftell($this->fp) == 0)) ||
                    ($this->info['filesize'] < 0) ||
                    (ftell($this->fp) < 0)) {
                        $real_filesize = getid3_lib::getFileSizeSyscall($this->info['filenamepath']);

                        if ($real_filesize === false) {
                            unset($this->info['filesize']);
                            fclose($this->fp);
                            throw new getid3_exception('Unable to determine actual filesize. File is most likely larger than '.round(PHP_INT_MAX / 1073741824).'GB and is not supported by PHP.');
                        } elseif (getid3_lib::intValueSupported($real_filesize)) {
                            unset($this->info['filesize']);
                            fclose($this->fp);
                            throw new getid3_exception('PHP seems to think the file is larger than '.round(PHP_INT_MAX / 1073741824).'GB, but filesystem reports it as '.number_format($real_filesize / 1073741824, 3).'GB, please report to info@getid3.org');
                        }
                        $this->info['filesize'] = $real_filesize;
                        
Home | Imprint | This part of the site doesn't use cookies.