8

I'm calling a method that expects a stream resource for a file, like this:

$obj->method(fopen($splFileInfo, 'r+'));

The $splFileInfo object is an instance of SplFileInfo.

Is there a way to get the stream resource of the $splFileInfo object without having to call fopen?

Daniel Ribeiro
  • 10,156
  • 12
  • 47
  • 79
  • 2
    It appears not :( https://bugs.php.net/bug.php?id=44392 – Anthony Sterling Dec 04 '13 at 12:11
  • 2
    The ability to retrieve a stream resource from `SplFileInfo` doesn't make too much sense (since they don't have to be used with files that actually exist), but it would be nice to introduce the ability for the `SplFileObject` class (as in the bug report Anthony mentioned) which should have a stream resource available internally. – salathe Dec 26 '13 at 15:40

0 Answers0