Skip to content

flaphl/filesystem

Repository files navigation

Flaphl Filesystem Element

Filesystem utilities pulled from Flaphl elements.

Installation

composer require flaphl/filesystem

Features

  • Cross-platform compatibility - Works seamlessly on Windows, macOS, and Linux
  • Comprehensive file operations - Read, write, copy, move, delete with proper error handling
  • Directory management - Create, remove, mirror directories recursively
  • Path utilities - Normalize, join, and manipulate file paths safely
  • Security features - Path traversal protection and validation
  • Exception-driven - Clear error reporting with typed exceptions

Basic Usage

use Flaphl\Element\Filesystem\Filesystem;
use Flaphl\Element\Filesystem\Path;

$fs = new Filesystem();

// Basic file operations
$fs->writeFile('/path/to/file.txt', 'Hello World!');
$content = $fs->readFile('/path/to/file.txt');

// Directory operations
$fs->mkdir('/path/to/directory');
$fs->copy('/source/directory', '/target/directory');

// Path utilities
$normalized = Path::normalize('/path/../to/./file.txt'); // '/to/file.txt'
$joined = Path::join('/base', 'subdir', 'file.txt'); // '/base/subdir/file.txt'

About

filesystem utilities pulled from Flaphl elements.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages