Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:53

0001 #include "Utilities/StorageFactory/test/Test.h"
0002 #include "Utilities/StorageFactory/interface/Storage.h"
0003 #include "FWCore/Utilities/interface/Exception.h"
0004 
0005 int main(int, char** /*argv*/) try {
0006   initTest();
0007 
0008   using namespace edm::storage;
0009   auto s = StorageFactory::get()->open("/etc/passwd");
0010   char buf[1024];
0011   IOSize n;
0012 
0013   while ((n = s->read(buf, sizeof(buf))))
0014     std::cout.write(buf, n);
0015 
0016   s->close();
0017 
0018   std::cout << StorageAccount::summaryText(true) << std::endl;
0019   return EXIT_SUCCESS;
0020 } catch (cms::Exception const& e) {
0021   std::cerr << e.explainSelf() << std::endl;
0022   return EXIT_FAILURE;
0023 } catch (std::exception const& e) {
0024   std::cerr << e.what() << std::endl;
0025   return EXIT_FAILURE;
0026 }