PHPackages                             vincepare/dirscan - 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. vincepare/dirscan

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

vincepare/dirscan
=================

File system scanner

1.3.0(8y ago)7131Apache-2.0PHPPHP &gt;=5.3.0

Since Dec 12Pushed 8y ago2 watchersCompare

[ Source](https://github.com/vincepare/DirScan)[ Packagist](https://packagist.org/packages/vincepare/dirscan)[ Docs](https://github.com/vincepare/DirScan)[ RSS](/packages/vincepare-dirscan/feed)WikiDiscussions master Synced today

READMEChangelog (6)DependenciesVersions (5)Used By (0)

DirScan - file system inventory
-------------------------------

[](#dirscan---file-system-inventory)

DirScan is a file cataloging command line tool that lists all files inside a directory and its sub-directories to a text file, with file attributes like timestamps and permissions.

It can be used to compare all files in an entire partition at different times and see what changed between.

Example :

```
dirscan --deep --same-device / > "drive-content.txt"

```

DirScan is bundled with a text reporter, but you can customize its output by creating your own reporting class, allowing to save data to, say, CSV, XML or an SQLite database.

### Download

[](#download)

Download dirscan.phar, make it executable (chmod +x dirscan.phar) and rename it if you want. On Linux, store it to `/usr/local/bin` to make it available everywhere :

```
wget -O dirscan https://github.com/vincepare/DirScan/releases/download/1.3.0/dirscan.phar
chmod +x dirscan
sudo mv dirscan /usr/local/bin/dirscan

```

##### Update

[](#update)

```
wget -O "$(which dirscan)" https://github.com/vincepare/DirScan/releases/download/1.3.0/dirscan.phar

```

### Requirement

[](#requirement)

Tested on PHP 5.3, 5.4, 5.5 &amp; 5.6. There is also a [legacy release](https://raw.githubusercontent.com/vincepare/DirScan/master/src/legacy/dirscan) that works on PHP 5.2 with some limitations.

### Usage

[](#usage)

```
Usage :
  dirscan [OPTIONS] TARGET...

Options :
  --help, -h        This help message
  --version, -v     Print software version
  --deep, -d        Explore symbolic links (default : skip)
  --flat, -f        Do not explore subdirectories
  --same-device     Explore only directories on the same device as the start directory
                    Useful on Linux, to ignore special mount points like /sys or /proc
  --access, -a      Report access time
  --htime, -t       Report user friendly date nearby unix timestamps
  --perms, -p       Report file permissions
  --full            Report all properties
  --format=STRING   Custom reporting format, call with empty string to print format help

```

#### Formats

[](#formats)

Format tokens to customize output (`--format`) :

```
  %u   Unique path
  %t   Type
  %s   Size
  %c   ctime
  %C   Change time
  %m   mtime
  %M   Modify time
  %a   atime
  %A   Access time
  %p   Permissions
  %o   UID
  %O   Owner
  %g   GID
  %G   Group
  %i   Inode
  %e   Extended

```

### Programmatic use

[](#programmatic-use)

Although dirscan is released as a command line tool, you can also use its internal `DirScan` class as a file system iterator. Dirscan is available as a composer package :

```
composer require vincepare/dirscan

```

##### How to use

[](#how-to-use)

```
require 'vendor/autoload.php';

use Vincepare\DirScan\DirScan;
use Vincepare\DirScan\Reporter;

class MyReporter extends Reporter
{
    public $files = [];

    public function push($node, DirScan $scanner)
    {
        $this->files[] = $node['path'];
    }
}

$settings = ['flat' => true];
$reporter = new MyReporter();
$scanner = new DirScan($settings, $reporter);
$scanner->scan('/tmp');
print_r($reporter->files);
```

### About windows

[](#about-windows)

DirScan is designed to work on a Unix environment (Linux or Mac OS) but you can also use it on Windows. In this case, beware of NTFS junction points and symbolic links that are not handled properly by old php releases (see [readlink](http://php.net/manual/en/function.readlink.php) &amp; [is\_link](http://php.net/manual/en/function.is-link.php)). But you'd better use other tools like [WhereIsIt](http://www.whereisit-soft.com/).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 70% 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 ~364 days

Total

3

Last Release

3125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/251526f87aac74401277a40bc612181175e5553417590588c2755c169311016f?d=identicon)[vincepare](/maintainers/vincepare)

---

Top Contributors

[![vincepare](https://avatars.githubusercontent.com/u/12776003?v=4)](https://github.com/vincepare "vincepare (7 commits)")[![finalclap](https://avatars.githubusercontent.com/u/3440976?v=4)](https://github.com/finalclap "finalclap (3 commits)")

---

Tags

filesystemiteratorreporting

### Embed Badge

![Health badge](/badges/vincepare-dirscan/health.svg)

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

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k665.7M2.5k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k277.8M976](/packages/league-flysystem-aws-s3-v3)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k40.9M130](/packages/knplabs-gaufrette)[knplabs/knp-gaufrette-bundle

Allows to easily use the Gaufrette library in a Symfony project

72430.0M102](/packages/knplabs-knp-gaufrette-bundle)[league/flysystem-local

Local filesystem adapter for Flysystem.

225254.9M75](/packages/league-flysystem-local)[oneup/flysystem-bundle

Integrates Flysystem filesystem abstraction library to your Symfony project.

65223.8M78](/packages/oneup-flysystem-bundle)

PHPackages © 2026

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