Eof

How can I write EOF into a file?
I tryed to do as follows:

size=sizeof(EOF);
end_of_file=EOF;

write(fdMutexRichieste, &end_of_file, size);

But it does non work correctly,
becouse in the next cicle (using lseek(..., SEEK_END) of my code it seems to ignore my EOF and use the LAST (and ORIGINAL) EOF.

Something like this?

end_of_file = '0x04'
write(fdMutexRichieste, &end_of_file, sizeof(end_of_file));

Regards

If I have 2 EOF witten on a file than I close the file.
I re-open it, I seek for the END (SEEK_END), which one of the two EOF are used?

Is it correct to insert an EOF to a file if I use the file as a PIPE?
So I insert from SEEK_SET
I "remove" from SEEK_END.

It does not change anything

No, I don't think that's the solution, maybe you've to flush the buffer?

I use a file for inter process comunication.
I insert variables from the start of the.
I remove the variables starting from EOF