How to read file from remote system share

Toshiba Dvr620 dvd/vcr combo
September 16, 2010 at 04:11:38
Specs: Windows XP
My program goes this way--

#include<fstream>

std:string FilePath= "\\\\10.21.21.235\\temp\\LOG.txt";

std::ofstream FP(FilePath.c_str(), std::ios::out);

if(FP.is_open())
{
FP.write(FilePath.c_str(),FilePath.length());
}
else
cout<<"File not opened"

Now Output is:
File not opened

SO i dont find what exactly here the problem is I have given full acess to share as well.



See More: How to read file from remote system share

Report •


#1
September 16, 2010 at 06:34:01
std:string FilePath= "\\\\10.21.21.235\\temp\\LOG.txt";
I'm going to assume this is a copy/paste error, but you only have one colon here.

Something else is going on; call Window's ::GetLastError() to find out what. (You'll have to include Windows.h, obviously.)


Report •

#2
September 17, 2010 at 02:25:57
How can I use GetLastError() method in my problem .I never used this before.

Report •

#3
September 17, 2010 at 05:33:15
Step 1) Follow the link I gave you in my previous response.
Step 2) Paste the function provided in that link.
Step 3) Call that function instead of just dumping your error message.

Report •
Related Solutions


Ask Question