PHPackages                             fyre/filesystem - 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. fyre/filesystem

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

fyre/filesystem
===============

A file/folder library.

v3.0.3(8mo ago)0651↓77.8%16MITPHP

Since Dec 24Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/elusivecodes/FyreFileSystem)[ Packagist](https://packagist.org/packages/fyre/filesystem)[ RSS](/packages/fyre-filesystem/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (5)Versions (27)Used By (6)

FyreFileSystem
==============

[](#fyrefilesystem)

**FyreFileSystem** is a free, open-source file/folder library for *PHP*.

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Files](#files)
- [Folders](#folders)

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

[](#installation)

**Using Composer**

```
composer require fyre/filesystem

```

In PHP:

```
use Fyre\FileSystem\File;
use Fyre\FileSystem\Folder;
```

Files
-----

[](#files)

- `$path` is a string representing the file path.
- `$create` is a boolean indicating whether to create the file if it doesn't exist, and will default to *false*.

```
$file = new File($path, $create);
```

**Access Time**

Get the file access time.

```
$accessTime = $file->accessTime();
```

**Base Name**

Get the filename.

```
$baseName = $file->baseName();
```

**Chmod**

Change the file permissions.

- `$permissions` is a number representing the file permissions.

```
$file->chmod($permissions);
```

**Close**

Close the file handle.

```
$file->close();
```

**Contents**

Get the contents of the file.

```
$contents = $file->contents();
```

**Copy**

Copy the file to a new destination.

- `$destination` is a string representing the destination path.
- `$overwrite` is a boolean indicating whether to overwrite an existing file, and will default to *true*.

```
$file->copy($destination, $overwrite);
```

**Create**

Create the file.

```
$file->create();
```

**Csv**

Parse CSV values from a file.

- `$length` is a number representing the maximum line length, and will default to 0.
- `$separator` is a string representing the field separator, and will default to "*,*".
- `$enclosure` is a string representing the field enclosure character, and will default to "*"*".
- `$escape` is a string representing the escape character, and will default to "*\\*".

```
$data = $file->csv($length, $separator, $enclosure, $escape);
```

**Delete**

Delete the file.

```
$file->delete();
```

**Dir Name**

Get the directory name.

```
$dirName = $file->dirName();
```

**Ended**

Determine whether the pointer is at the end of the file.

```
$ended = $file->ended();
```

**Exists**

Determine whether the file exists.

```
$exists = $file->exists();
```

**Extension**

Get the file extension.

```
$extension = $file->extension();
```

**File Name**

Get the filename (without extension).

```
$fileName = $file->fileName();
```

**Folder**

Get the *Folder*.

```
$folder = $file->folder();
```

**Group**

Get the file group.

```
$group = $file->group();
```

**Is Executable**

Determine whether the file is executable.

```
$isExecutable = $file->isExecutable();
```

**Is Readable**

Determine whether the file is readable.

```
$isReadable = $file->isReadable();
```

**Is Writable**

Determine whether the file is writable.

```
$isWritable = $file->isWritable();
```

**Lock**

Lock the file handle.

- `$operation` is a number representing the lock operation, and will default to *LOCK\_SH*.

```
$lock = $file->lock($operation);
```

**MIME Type**

Get the MIME content type.

```
$mimeType = $file->mimeType();
```

**Modified Time**

Get the file modified time.

```
$modifiedTime = $file->modifiedTime();
```

**Open**

Open a file handle.

- `$mode` is a string representing the access mode, and will default to "*r*".

```
$open = $file->open($mode);
```

**Owner**

Get the file owner.

```
$owner = $file->owner();
```

**Path**

Get the full path to the file.

```
$path = $file->path();
```

**Permissions**

Get the file permissions.

```
$permissions = $file->permissions();
```

**Read**

Read file data.

- `$length` is a number representing the number of bytes to read.

```
$data = $file->read($length);
```

**Rewind**

Rewind the pointer position.

```
$file->rewind();
```

**Seek**

Move the pointer position.

- `$offset` is a number representing the pointer position.

```
$file->seek($offset);
```

**Size**

Get the size of the file (in bytes).

```
$size = $file->size();
```

**Tell**

Get the current pointer position.

```
$offset = $file->tell();
```

**Touch**

Touch the file.

- `$time` is a number representing the modified timestamp, and will default to `time()`.
- `$accessTime` is a number representing the access timestamp, and will default to `$time`.

```
$file->touch($time, $accessTime);
```

**Truncate**

Truncate the file.

- `$size` is a number representing the size to truncate to, and will default to 0.

```
$file->truncate($size);
```

**Unlock**

Unlock the file handle.

```
$file->unlock();
```

**Write**

Write data to the file.

- `$data` is a string representing the data to write.

```
$file->write($data);
```

Folders
-------

[](#folders)

- `$path` is a string representing the folder path.
- `$create` is a boolean indicating whether to create the folder if it doesn't exist, and will default to *false*.
- `$permissions` is a number representing the permissions to create the folder with, and will default to *0755*.

```
$folder = new Folder($path, $create, $permissions);
```

**Contents**

Get the contents of the folder.

```
$contents = $folder->contents();
```

This method will return an array containing the contents of the folder, as *File* and *Folder* objects.

**Copy**

Copy the folder to a new destination.

- `$destination` is a string representing the destination path.
- `$overwrite` is a boolean indicating whether to overwrite existing files, and will default to *true*.

```
$folder->copy($destination, $overwrite);
```

**Create**

Create the folder.

- `$permissions` is a number representing the permissions to create the folder with, and will default to *0755*.

```
$folder->create($permissions);
```

**Delete**

Delete the folder (including all contents).

```
$folder->delete();
```

**Empty**

Empty the folder.

```
$folder->empty();
```

**Exists**

Determine whether the folder exists.

```
$exists = $folder->exists();
```

**Is Empty**

Determine whether the folder is empty.

```
$isEmpty = $folder->isEmpty();
```

**Move**

Move the folder to a new destination.

- `$destination` is a string representing the destination path.
- `$overwrite` is a boolean indicating whether to overwrite existing files, and will default to *true*.

```
$newFolder = $folder->move($destination, $overwrite);
```

**Name**

Get the folder name.

```
$name = $folder->name();
```

**Path**

Get the full path to the folder.

```
$path = $folder->path();
```

**Size**

Get the size of the folder (in bytes).

```
$size = $folder->size();
```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance62

Regular maintenance activity

Popularity14

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~56 days

Recently: every ~17 days

Total

26

Last Release

241d ago

Major Versions

v1.0.9 → v2.02023-07-16

v2.0.11 → v3.02025-08-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/fad81fd5941e3a637c8a5749d05ae3ed9314d5e2fee57f59c3d9ec3b41259c6b?d=identicon)[elusivecodes](/maintainers/elusivecodes)

---

Top Contributors

[![elusivecodes](https://avatars.githubusercontent.com/u/18050480?v=4)](https://github.com/elusivecodes "elusivecodes (17 commits)")

---

Tags

filefile-systemfolderphp

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/fyre-filesystem/health.svg)

```
[![Health](https://phpackages.com/badges/fyre-filesystem/health.svg)](https://phpackages.com/packages/fyre-filesystem)
```

###  Alternatives

[venveo/craft-compress

Create smart zip files from Craft assets on the fly

124.7k](/packages/venveo-craft-compress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
