# symfony/filesystem

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/symfony-filesystem).**

4,646 stars · 48 forks · PHP · MIT

## Links

- GitHub: https://github.com/symfony/filesystem
- Homepage: https://symfony.com/filesystem
- awesome-repositories: https://awesome-repositories.com/repository/symfony-filesystem.md

## Topics

`component` `php` `symfony` `symfony-component`

## Description

This is a PHP filesystem utility library that provides tools for manipulating files, directories, and symbolic links. It serves as a specialized set of tools for atomic writing, path normalization, recursive directory management, and cross-platform file manipulation.

The project features a dedicated atomic file writer that saves content to temporary locations before moving them to a final destination to prevent data corruption. It includes a recursive directory manager for creating, deleting, and modifying permissions for nested folder structures and their contents, as well as a path normalization tool for resolving relative paths and identifying shared root directories.

The library covers a broad surface of filesystem primitives, including file and directory copying, renaming, and deletion. It provides capabilities for path management, such as root extraction and segment joining, and includes security tools for managing file ownership and access permissions recursively across directories.

## Tags

### Software Engineering & Architecture

- [Atomic File Writes](https://awesome-repositories.com/f/software-engineering-architecture/atomic-file-writes.md) — Implements a specialized atomic file writer that prevents data corruption by using temporary files before renaming.
- [Recursive Directory Traversers](https://awesome-repositories.com/f/software-engineering-architecture/recursive-validation-engines/recursive-tree-traversers/file-system-traversers/recursive-directory-traversers.md) — Recursively walks through nested directory structures to apply permissions, ownership, or deletion operations.
- [Path Normalizers](https://awesome-repositories.com/f/software-engineering-architecture/runtime-path-resolvers/path-normalizers.md) — Standardizes file separators and resolves relative segments to ensure consistent path behavior across different operating systems.
- [Path Relation Calculations](https://awesome-repositories.com/f/software-engineering-architecture/runtime-path-resolvers/path-normalizers/path-relation-calculations.md) — Provides utilities to calculate the relative distance and relationship between two filesystem paths.

### Data & Databases

- [Directory Creation](https://awesome-repositories.com/f/data-databases/directory-creation.md) — Provides functionality to create nested directory structures and their missing parent hierarchies recursively. ([source](https://symfony.com/doc/current/components/filesystem.html))
- [File Existence Checks](https://awesome-repositories.com/f/data-databases/data-management/unique-identifier-generators/uniqueness-enforcement/duplicate-prevention/file-existence-checks.md) — Verifies if one or more files or directories exist on the disk. ([source](https://symfony.com/doc/current/components/filesystem.html))

### Development Tools & Productivity

- [Filesystem Manipulation Utilities](https://awesome-repositories.com/f/development-tools-productivity/directory-management/administrative-directory-managers/filesystem-directory-operations/filesystem-manipulation-utilities.md) — Provides a consistent PHP API for reading, writing, copying, moving, and deleting files and directories across operating systems.
- [Recursive Hierarchy Management](https://awesome-repositories.com/f/development-tools-productivity/directory-management/administrative-directory-managers/recursive-hierarchy-management.md) — Creates recursive folder structures and manages access permissions or ownership for complex directory hierarchies.
- [Timestamp-Based Overwrite Policies](https://awesome-repositories.com/f/development-tools-productivity/file-copying-utilities/clipboard-based-file-copying/timestamp-based-overwrite-policies.md) — Determines whether to overwrite destination files by comparing source and destination modification timestamps.
- [Directory Copying](https://awesome-repositories.com/f/development-tools-productivity/file-copying-utilities/privileged-file-copying/directory-copying.md) — Duplicates files or entire directory trees and uses modification dates to manage overwrites. ([source](https://symfony.com/doc/current/components/filesystem.html))

### Operating Systems & Systems Programming

- [Path Manipulations](https://awesome-repositories.com/f/operating-systems-systems-programming/file-i-o-management/path-manipulations.md) — Provides tools for constructing, parsing, and manipulating filesystem path strings for consistency.
- [Filesystem API Abstractions](https://awesome-repositories.com/f/operating-systems-systems-programming/filesystem-api-abstractions.md) — Wraps low-level PHP filesystem functions to provide a consistent, OS-agnostic interface for files and symbolic links.
- [Recursive Directory Managers](https://awesome-repositories.com/f/operating-systems-systems-programming/recursive-directory-managers.md) — Offers utilities for the recursive creation, removal, and permission management of nested folder structures.
- [File System Operations](https://awesome-repositories.com/f/operating-systems-systems-programming/system-administration-maintenance/file-system-management/file-system-operations.md) — Provides standardized functions for core filesystem tasks including creation, deletion, and modification. ([source](https://cdn.jsdelivr.net/gh/symfony/filesystem@8.2/README.md))
- [Cross-Platform File Operations](https://awesome-repositories.com/f/operating-systems-systems-programming/system-administration-maintenance/file-system-management/file-system-utilities/cross-platform-file-operations.md) — Provides unified interfaces for performing basic file operations like copy, move, and delete across different operating systems.
- [File Renaming and Relocations](https://awesome-repositories.com/f/operating-systems-systems-programming/file-renaming-and-relocations.md) — Changes the name or directory location of specific files and folders within the filesystem. ([source](https://symfony.com/doc/current/components/filesystem.html))
- [File Write and Append Operations](https://awesome-repositories.com/f/operating-systems-systems-programming/file-write-and-append-operations.md) — Allows adding content to the end of files while automatically ensuring parent directories exist. ([source](https://symfony.com/doc/current/components/filesystem.html))
- [Filesystem Deletion Utilities](https://awesome-repositories.com/f/operating-systems-systems-programming/filesystem-deletion-utilities.md) — Removes files, folders, and symbolic links from the storage system. ([source](https://symfony.com/doc/current/components/filesystem.html))
- [Timestamp Modification](https://awesome-repositories.com/f/operating-systems-systems-programming/system-administration-maintenance/system-clock-utilities/timestamp-injection/file-timestamp-preservers/timestamp-modification.md) — Sets and updates access and modification times for files to track metadata changes. ([source](https://symfony.com/doc/current/components/filesystem.html))
- [Temporary File Generators](https://awesome-repositories.com/f/operating-systems-systems-programming/temporary-file-generators.md) — Generates uniquely named files in system temporary locations for short-term application data storage.

### System Administration & Monitoring

- [Symbolic Link Managers](https://awesome-repositories.com/f/system-administration-monitoring/administrative-operations/folder-management/cloud-folder-links/internal-file-link-generators/symbolic-link-managers.md) — Implements utilities for creating symbolic links and resolving their absolute target locations on disk. ([source](https://symfony.com/doc/current/components/filesystem.html))

### Programming Languages & Runtimes

- [Common Path Finders](https://awesome-repositories.com/f/programming-languages-runtimes/common-path-finders.md) — Analyzes multiple absolute paths to identify the longest shared root directory among them. ([source](https://symfony.com/doc/current/components/filesystem.html))
- [Path Root Extractors](https://awesome-repositories.com/f/programming-languages-runtimes/path-root-extractors.md) — Extracts the parent directory or system root from a filesystem path across different environments. ([source](https://symfony.com/doc/current/components/filesystem.html))
- [Path Segment Joiners](https://awesome-repositories.com/f/programming-languages-runtimes/path-segment-joiners.md) — Concatenates multiple path segments into a single normalized filesystem path by resolving separators. ([source](https://symfony.com/doc/current/components/filesystem.html))

### Web Development

- [Full File Readings](https://awesome-repositories.com/f/web-development/api-management-tools/api-development-management/web-apis/file-reading/full-file-readings.md) — Reads the full text of a file into a string and provides error reporting for invalid paths. ([source](https://symfony.com/doc/current/components/filesystem.html))
