[wp-trac] [WordPress Trac] #34772: get_contents won't unlink tempfile when ftp_fget returns false

WordPress Trac noreply at wordpress.org
Wed Nov 25 08:39:26 UTC 2015


#34772: get_contents won't unlink tempfile when ftp_fget returns false
-------------------------------------------+-----------------------------
 Reporter:  ruud@…                         |       Owner:
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Future Release
Component:  Filesystem API                 |     Version:  4.3.1
 Severity:  normal                         |  Resolution:
 Keywords:  has-patch commit dev-feedback  |     Focuses:
-------------------------------------------+-----------------------------
Changes (by ruud@…):

 * keywords:  has-patch commit => has-patch commit dev-feedback


Comment:

 Hi dd32,

 Thanks for your quick follow-up.
 I was looking into this piece of code because our server was bogged down
 with trying to seek for a new non existing temp file name.
 We ran into errors like:
 [23-Nov-2015 07:32:00 UTC] PHP Warning:  unlink(/tmp/debug180541.tmp): No
 such file or directory in ..

 but that meant the server already had gone form debug1.tmp all the way up
 until debug180541.tmp opening files.. etc. to get to a non-existing .tmp
 file.

 While I do like enumeration like this, wouldn't something like using a
 (part of?) unix timestamp also suffice, and be way more faster?

 Such an approach would also alleviate possible future unlink problems as
 well, but I'm not sure if the current methodology of getting unique
 filenames has more to it, like it has to be sequential or something.

 Thanks,
 Ruud

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34772#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list