php.net |  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
Votes:1
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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: anatoliy dot danchuk dot softimus at gmail dot com
New email:
PHP Version: OS:

 

 [2017-06-17 13:05 UTC] anatoliy dot danchuk dot softimus at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/class.splfileobject
---
How delete/remove/rename file after create object ? 

http://ua2.php.net/manual/en/class.splfileobject.php#113149

Test script:
---------------
<?php 
$file_object = new SplFileObject(__FILE__);

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

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




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-20 13:26 UTC] cmb@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 05 15:01:27 2024 UTC