Skip to content

Commit

Permalink
Updated file handling, experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
markseuffert committed May 1, 2024
1 parent 999f1fa commit dae64c1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions system/workers/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,7 @@ public function writeFile($fileName, $fileData, $mkdir = false) {
if (flock($fileHandle, LOCK_EX)) {
ftruncate($fileHandle, 0);
fwrite($fileHandle, $fileData);
fflush($fileHandle);
flock($fileHandle, LOCK_UN);
}
fclose($fileHandle);
Expand All @@ -2149,6 +2150,7 @@ public function appendFile($fileName, $fileData, $mkdir = false) {
clearstatcache(true, $fileName);
if (flock($fileHandle, LOCK_EX)) {
fwrite($fileHandle, $fileData);
fflush($fileHandle);
flock($fileHandle, LOCK_UN);
}
fclose($fileHandle);
Expand Down

0 comments on commit dae64c1

Please sign in to comment.