Ascii file

I am having problems opening/making a histogram in ROOT using files. I used the code from the tutorial and got it to work about an hour ago. It won’t work now. Here is my code:

[code]void nebasic() {

TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());

TFile *f = new TFile(“basic2.root”,“RECREATE”);
TH1F *h1 = new TH1F(“h1”,“Flux”,100,-4,4);
TTree T = new TTree(“ntuple”,“data from ascii file”);
Long64_t nlines = T->ReadFile(Form("/home/monsoon/Desktop/shar/",dir.Data()),“flux:x:y”);
printf(" found %lld points\n",nlines);

When I try to run this in Root I get this:

[quote]root [3] .x nebasic.C
Error: Missing one of ‘;,}’ expected at or after line 8.
Error: Unexpected end of file (G__fignorestream():3) nebasic.C:14:
Error: Missing closing brace for the block opened around line 1.
Error: Unexpected end of file (G__exec_statement()) nebasic.C:14:
*** Interpreter error recovered ***

How do I fix this?

Try with:
Long64_t nlines = T->ReadFile("/home/monsoon/Desktop/shar/", “flux:x:y”);
Long64_t nlines = T->ReadFile(dir + “”, “flux:x:y”);
Long64_t nlines = T->ReadFile(TString::Format("", dir.Data()), “flux:x:y”);

Thank you, that worked. I also fixed a problem in my code that I didn’t catch before. Thank you for your help.