Req #74772 [Opn]: splfileobject lock and unavailable FCLOSE, REMOVE file.

From: Date: Tue, 20 Apr 2021 13:26:41 +0000
Subject: Req #74772 [Opn]: splfileobject lock and unavailable FCLOSE, REMOVE file.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233529@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74772&edit=1

 ID:                 74772
 Updated by:         cmb@php.net
 Reported by:        anatoliy dot danchuk dot softimus at gmail dot com
 Summary:            splfileobject lock and unavailable FCLOSE, REMOVE
                     file.
 Status:             Open
 Type:               Feature/Change Request
 Package:            SPL related
 Operating System:   Ubuntu
 PHP Version:        7.0.20
 Block user comment: N
 Private report:     N

 New Comment:

The file descriptor should be closed as soon as the SplFileObject
is destroyed.  There is, apparently, no way to unlink the file.


Previous Comments:
------------------------------------------------------------------------
[2017-06-17 13:05:45] 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.





------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74772&edit=1


Thread (2 messages)

« previous php.bugs (#233529) next »