CoEPP RC
 

Xrootd C++ client libraries

#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <sys/time.h>
#include <math.h>

#include "XrdClient/XrdClientEnv.hh"
#include "XrdSys/XrdSysHeaders.hh"
#include <XrdClient/XrdClient.hh>

kXR_unt16 open_mode = (kXR_ur);
kXR_unt16 open_opts = (0);

//To compile
//g++ mytest.cc -I/usr/include/xrootd -lXrdClient -o mytest

int main(void)
{

  char mybuffer[100];

  XrdClient *cli = new XrdClient("root://xrdsydsr.syd.coepp.org.au//coepp/local/antonio/eggs");
  cli->Open(open_mode,1);
  cli->Read(mybuffer,0,30);
  std::cout << mybuffer ;

  return 1;
}

To run and compile

vm-115-146-84-190:./xrdtestcpp>g++ mytest.cc -I/usr/include/xrootd -lXrdClient -o mytest
vm-115-146-84-190:./xrdtestcpp>./mytest
hello world
tier3/faq/xrd_client_cpp.txt · Last modified: 2014/03/24 20:15 by antonio
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki