Bug #77365 [Com]: tmpfile() is not being cleaned up

From: Date: Sun, 30 Dec 2018 14:28:43 +0000
Subject: Bug #77365 [Com]: tmpfile() is not being cleaned up
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218685@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77365&edit=1 ID: 77365 Comment by: spam2 at rhsoft dot net Reported by: gadelat at gmail dot com Summary: tmpfile() is not being cleaned up Status: Open Type: Bug Package: Filesystem function related Operating System: Ubuntu 18.04 PHP Version: 7.2.14RC1 Block user comment: N Private report: N New Comment: ctrl+c = sigterm and so why should there be no way? Previous Comments: ------------------------------------------------------------------------ [2018-12-30 09:33:14] gadelat at gmail dot com There is no way in PHP to clean up tmpfiles when script is terminated with ctrl+c in cross platform compatible way :( ------------------------------------------------------------------------ [2018-12-30 00:01:08] gadelat at gmail dot com Just found that following for some reason DOES delete the file <?php $stream = tmpfile(); pcntl_async_signals(true); pcntl_signal(SIGINT, function() { exit(0); }); while(true); ------------------------------------------------------------------------ [2018-12-28 18:00:49] gadelat at gmail dot com Description: ------------ Might be duplicate of https://bugs.php.net/bug.php?id=67105 but created this issue anyway, since that report wasn't acknowledged and aims for documentation instead of fixing the cleanup process. Anyway, bug is that interrupting script via CTRL+C prevents tmpfile cleanup. Test script: --------------- tmpfile(); while(true) // execute this and press ctrl+c Expected result: ---------------- no new php* files in /tmp/ Actual result: -------------- new php* file in /tmp/ ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77365&edit=1

« previous php.bugs (#218685) next »