# Persistent streams in an extension

- Thread: https://externals.io/message/24250
- Original archive: https://news-web.php.net/php.internals/24250
- Started by Andrew Mather on 2006-07-03T19:26:49+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #24250 — Andrew Mather — 2006-07-03T19:26:49+00:00

URL: https://externals.io/message/24250#24250

I am trying to use a php_stream* as a global
(and hence persistent) resource, but gdb detects
a memory leak at the end of the request, and subsequent
calls to the stream say the stream is no longer seekable.

How do I declare a php_stream (opened presumably with
php_stream_open_wrapper) to be a persistent resource,
such that I will close it only on module shutdown?

Cheers,

Andrew.
