Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@trowski
Copy link
Member

@trowski trowski commented Dec 6, 2024

An alternative to #80 which combines using flock with file deletion to make a best-effort to cleanup temporary files.

Comment on lines 46 to 47
$handle = \fopen($this->fileName, 'c');
if ($handle && \flock($handle, \LOCK_EX | \LOCK_NB)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fopen is a blocking function, but assuming a local file is being opened this should be a reasonable trade-off, and the only way flock can be used in PHP to my knowledge.

@trowski
Copy link
Member Author

trowski commented Jan 12, 2025

Superseded by #87.

@trowski trowski closed this Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants