> if these files have been created under windows and copied in linux (i am
developing under linux) would this change something? do they need
different handling? I cannot think something else at the moment as the
module is tested under windows
Probably, and assuming we are taking about binary files. In *nixes there
are a few differences on how files are handled than in Windows.
More specificaly:
"The C++ library <fstream> recognizes two kinds of files: binary and
text files. By default all files are opened as text files. To open a
binary file you should include the ios::binary value in the openmode
argument for the open function such as:
ifstream inputFile
inputFile.open("somename.bin", ios::in | ios::binary);
On some operating platforms (e.g. Unix) there is no difference between
binary files and text files and the use of the ios::binary argument has
no effect. On other platforms (e.g. MSDos, Windows) they have a distinct
difference.
Thos platforms that differentiate between text files and binary files do
so in these ways:
1. When a program writes a newline (\n) character to a binary file, the
file system writes the single newline character which on most platforms
is the same as the linefeed (0x0a) character
2. When the program writes a newline character to a text file, the files
system writes two characters: a carriage return character (0x0d)
followed by a linefeed character (0x0a)
3. When the program reads a newline character from a binary file, the
file system reads the signle newline character into memory
4. When the program reads a carriage return/linefeed character pair from
a text file, the system translates the pair into a single newline
character in memory.
5. When the program reads a single newline character -a linefeed that is
not preceded by a carriage return character- from a text file, the file
system inserts the newline character into memory.
This approach has significant implications mainly involving file
position operations -seeking and telling. "
Hope this helps
V.Z.