r+: Open for reading and writing. The stream is positioned at the beginning of the file. w+:Open for reading and writing. The file is created if it does not exist, otherwise it is truncated. The stream is positioned at the beginning of the file. r+具有讀寫屬性,從文件頭開始寫,保留原文件中沒有被覆蓋的內(nèi)容; w+具有讀寫屬性,寫的時(shí)候如果文件存在,會(huì)被清空,從頭開始寫。
r 打開只讀文件,該文件必須存在。 |
|
來(lái)自: angelbrian > 《我的圖書館》