PHPackages                             tecnickcom/tc-lib-file - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. tecnickcom/tc-lib-file

ActiveLibrary[File &amp; Storage](/categories/file-storage)

tecnickcom/tc-lib-file
======================

PHP library to read byte-level data from files

3.6.1(1w ago)8907.7k↓20.5%43LGPL-3.0-or-laterPHPPHP &gt;=8.2CI passing

Since Jul 29Pushed 3w ago3 watchersCompare

[ Source](https://github.com/tecnickcom/tc-lib-file)[ Packagist](https://packagist.org/packages/tecnickcom/tc-lib-file)[ Docs](https://tcpdf.org)[ GitHub Sponsors](https://github.com/sponsors/tecnickcom)[ RSS](/packages/tecnickcom-tc-lib-file/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (10)Versions (130)Used By (3)

tc-lib-file
===========

[](#tc-lib-file)

> PHP utilities for low-level file access and byte-level reading.

[![Latest Stable Version](https://camo.githubusercontent.com/107c4a73df2f64c221fe8fb8d37042d7b707b8900d968de2562ee874c94765cc/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d66696c652f76657273696f6e)](https://packagist.org/packages/tecnickcom/tc-lib-file)[![Build](https://github.com/tecnickcom/tc-lib-file/actions/workflows/check.yml/badge.svg)](https://github.com/tecnickcom/tc-lib-file/actions/workflows/check.yml)[![Coverage](https://camo.githubusercontent.com/15306aad5242f61b4bb83cde9d506d62b07506f477feafd046f0f9c33f37590e/68747470733a2f2f636f6465636f762e696f2f67682f7465636e69636b636f6d2f74632d6c69622d66696c652f67726170682f62616467652e7376673f746f6b656e3d695a39736e77676b5541)](https://codecov.io/gh/tecnickcom/tc-lib-file)[![License](https://camo.githubusercontent.com/dd6cd578762e6de1e78a568bcd3d9d22eef8bd79e8ab37df246e91c21edf725c/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d66696c652f6c6963656e7365)](https://packagist.org/packages/tecnickcom/tc-lib-file)[![Downloads](https://camo.githubusercontent.com/949c0f66a3b78764327f485749b48ef0a48b4ab899848ec25c049626d61639d9/68747470733a2f2f706f7365722e707567782e6f72672f7465636e69636b636f6d2f74632d6c69622d66696c652f646f776e6c6f616473)](https://packagist.org/packages/tecnickcom/tc-lib-file)

[![Sponsor on GitHub](https://camo.githubusercontent.com/dd89cb32d6e7ff9dbb0fa7ce84923567358b220feb9198b3720beabc3153da6a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73706f6e736f722d6769746875622d4541344141412e7376673f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d7768697465)](https://github.com/sponsors/tecnickcom)

> 💖 Part of the [tc-lib-pdf / TCPDF](https://github.com/tecnickcom/tc-lib-pdf) ecosystem (100M+ installs). [Sponsor its maintenance →](https://github.com/sponsors/tecnickcom)

---

Overview
--------

[](#overview)

`tc-lib-file` provides safe primitives for opening files, reading bytes, and handling binary-oriented workflows used by higher-level PDF and document libraries.

The package is intentionally small but critical: it centralizes low-level I/O concerns so higher-level libraries can focus on document semantics instead of stream safety and byte handling. This separation improves reliability, testability, and reuse across the broader Tecnick ecosystem.

**Namespace**`\Com\Tecnick\File`**Author**Nicola Asuni **License**[GNU LGPL v3](https://www.gnu.org/copyleft/lesser.html) - see [LICENSE](LICENSE)**API docs****Packagist**---

Features
--------

[](#features)

### File Access

[](#file-access)

- Local and URL-backed file reading helpers
- Path-safety checks for local operations
- cURL-based retrieval options for remote resources

### Binary Utilities

[](#binary-utilities)

- Byte, integer, and structured binary reads
- Helpers used by parser and image/font import stacks
- Error handling via typed exceptions

---

Requirements
------------

[](#requirements)

- PHP 8.2 or later
- Extensions: `curl`, `pcre`
- Composer

---

Installation
------------

[](#installation)

```
composer require tecnickcom/tc-lib-file
```

---

Quick Start
-----------

[](#quick-start)

```
