I'm searching for a solution to solve the above described problem.
Here's my "doesn't working code". charsInCurrentBuffer returns always -1!
#define BUFSIZE 512
char *bufferA = new char[BUFSIZE];
char *bufferB = new char[BUFSIZE];
const char *inputFile = "in.txt";
if ( (fdInputFile = open(inputFile, O_DIRECT) ) != -1) {
cout << "input opened!" << endl;
} else {
cout << "can't open input file!";
}
int charsInCurrentBuffer = read(fdInputFile, currBuffer, BUFSIZE);
cout << charsInCurrentBuffer << endl;