instead of file_id you can use boost::filesystem to iterate through the directory files.