|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74772 splfileobject lock and unavailable FCLOSE, REMOVE file.
Submitted: 2017-06-17 13:05 UTC Modified: 2021-04-20 13:26 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: anatoliy dot danchuk dot softimus at gmail dot com Assigned:
Status: Open Package: SPL related
PHP Version: 7.0.20 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
46 - 45 = ?
Subscribe to this entry?

 [2017-06-17 13:05 UTC] anatoliy dot danchuk dot softimus at gmail dot com
From manual page:
How delete/remove/rename file after create object ?

Test script:
$file_object = new SplFileObject(__FILE__);

// $file_object->closeFile(); 
// $file_object->fclose();
// $file_object->unlink();
// $file_object->rename();
// $file_object->move();

Expected result:
after $file_object = new SplFileObject(__FILE__);
I can close file descriptor, delete file.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-20 13:26 UTC]
The file descriptor should be closed as soon as the SplFileObject
is destroyed.  There is, apparently, no way to unlink the file.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 14:03:37 2021 UTC