btherl Posted April 23, 2007 Share Posted April 23, 2007 Is there any is_file_pointer_valid() in php? Something which will tell me either "Yes, that's a file pointer" or "No, whatever that thing is it isn't a file pointer" Quote Link to comment Share on other sites More sharing options...
btherl Posted April 23, 2007 Author Share Posted April 23, 2007 I found the following.. if (is_resource($fp) && get_resource_type($fp) === 'stream') { ... } But it doesn't distinguish between stream types.. to do that you need to use stream_get_meta_data() and look even deeper. I guess that is the price of flexibility. Quote Link to comment Share on other sites More sharing options...
trq Posted April 23, 2007 Share Posted April 23, 2007 get_resource_type should help you out. Quote Link to comment Share on other sites More sharing options...
btherl Posted April 23, 2007 Author Share Posted April 23, 2007 Thanks thorpe! I just learnt a whole lot about how complex php's streams and wrappers and so on really are Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.