Reading a text file line by line in CINT

How would I read a text file line by line in CINT?

I tried :
root [0] #include
root [1] #include
root [2] std::ifstream file(“filename.txt”)
root [3] std::string str;
root [4] { while (std::getline(file, str)){cout<<str<<endl;} }
(class ostream)1
root [5]

but as can be seen, it doesnt work…
Thanks

I tip your “filename.txt” file does not exist in the “current subdirectory” (or you have no permission to read it).