i have code works pipes , files. @ end of operation function should close resource.
can close pipe resource fclose? seems not hard php track how close resource see 2 functions.
i create pipe popen function.
otherwise need method distinguish pipe , file resources.
get_resource_type returns "stream" both resources.
or have implement expensive wrapper classes.
class pipestream { public function __desctruct() { pclose($this->resource); } } class filestream { public function __desctruct() { fclose($this->resource); } }
read documentation of pclose()
. used close process resource created popen()
rather named pipe.
if working called, named pipes, objects stored in file system, use:
- posix_mkfifo() create them
- fopen() open them
- fclose() close them
as see, create fifo requires posix
extension meaning not work on windows windows not support named pipes (or posix standard in general)
Comments
Post a Comment