1.在read和write间切换时一定要调用fseek,即使是位置不变也要调用一下fseek(file,0, SEEK_CUR);
2.在a+模式下,read完后要seek,不然写不出来;seek完后write一定写在最后,无论你seek在什么位置。a也一样写在最后,但不seek也能写。
3.fopen是c函数具有缓冲区,_open好象没有?是内核调用
4.t模式在windows会在回车符前自动加0x0d,统一加上b好了
5.估计fopen是_open的封装,有特殊要求可以自己写一个buff封装一个
6.When the “r+”, “w+”, or “a+” access type is specified, both reading and writing are enabled (the file is said to be open for “update”). However, when you switch from reading to writing, the input operation must encounter an EOF marker. If there is no EOF, you must use an intervening call to a file positioning function. The file positioning functions are fsetpos, fseek, and rewind. When you switch from writing to reading, you must use an intervening call to either fflush or to a file positioning function.