implement find_stream functions
cmd_fclose should not attempt to close if no valid stream found