Add `File\leaky_temporary_file()` (#181)
commite5b344df2af5a7d41bc14c9d4ec4d3ca027e2cbb
authorFred Emmott <fe@fb.com>
Tue, 15 Mar 2022 19:06:16 +0000 (15 12:06 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 15 Mar 2022 19:06:16 +0000 (15 12:06 -0700)
treed3f7a531f18b5aed0e7dbbba2b08b57460693029
parent180f52c2ec77308e1a5172450d382675cc014d69
Add `File\leaky_temporary_file()` (#181)

Summary:
This is a temporary file that is not automatically deleted.

Name is following the "if it's sometimes necessary but you don't want
people to use it, name it something scary" principle :p

Adding this based on looking into why some open source Facebook projects
(e.g. fbshipit) use PHP IO instead of HSL IO.

`File\temporary_file()` should be strongly preferred over this, but
sometimes it's needed.

link: https://github.com/hhvm/hsl/pull/181
Reviewed By: bigfootjon

Differential Revision: D34314199

fbshipit-source-id: 8513311c431861b2dfde9b8242702ef7f7585f5a
hphp/hsl/src/file/_Private/open_temporary_fd.php [new file with mode: 0644]
hphp/hsl/src/file/leaky_temporary_file.php [copied from hphp/hsl/src/file/temporary_file.php with 55% similarity]
hphp/hsl/src/file/temporary_file.php
hphp/hsl/tests/file/FileTest.php