My program has to read out a configuration file. This file contains some list with servers.
This works fine. The second part is finding the oldest log file on a specified path on the server. (For every server again). This also works fine.
I end up with the file path. I have to read out the whole file. Now comes the problem. Whatever I try, i only get back:
(SPACE)(some block, white)B
The file is a .log file. All permissions are fine. Readable by everyone. I can also read it via notepad.
To be clear:
Windows machine
Windows network
Reading file OVER the network into the c$ share.
The file is a text file.
I get bogus data back.
The right size is returned when seeking.
I am using C++ with fstream
I've found the STL does that kind of bogus bunkus with files when you don't open in ios::binary mode. 22fpLog.open(logFile.c_str(),ios::in|ios::binary);
If that doesn't help, then try this also: instead of using fpLog.seekg(0);, just close the file and open it again.
Thanx for the suggestions, but both solutions did not solve the problem.
They made no changes to the result.
I made a textfile in the same directory I want to read a file from. Succeeds.
I renamed the file to something with .log (test.log) and put the same data in
it as in the file I want to read for real. Succeeds.
I really don't understand why it fails reading the files.