This is available as File\open_write_only
in the www repository.
namespace HH\Lib\File;
function open_write_only(
string $path,
WriteMode $mode = WriteMode::OPEN_OR_CREATE,
int $create_file_permissions = 420,
): CloseableWriteHandle;
string $path
WriteMode $mode = WriteMode::OPEN_OR_CREATE
int $create_file_permissions = 420