php-component / atomic-file
Library for atomic operations with files
Installs: 35
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/php-component/atomic-file
Requires
- php: ~5.6
Requires (Dev)
- phpunit/phpunit: ^5.7.5
This package is not auto-updated.
Last update: 2025-10-12 08:45:28 UTC
README
AtomicFile is package for atomic operations with file. It guarantees nobody will overwrite your file, while you are writing into/reading file.
$file_path = dirname(__FILE__).'/../tmp/test.txt'; $reader = new PHPComponent\AtomicFile\AtomicFileReader($file_path); //create instance of Reader print_r($reader->readFile()); //read file
Important notice
It works only when other writers/readers use same class, function flock() cannot lock file for others functions then flock().