刪除某個檔案中特定一行原始碼

2021-06-12 07:52:28 字數 589 閱讀 1009

下面是一段關於刪除某個檔案中特定一行(知你事先知道這一行的內容)的c語言演算法**,修改後就可以運用在專案中

void func( char *type)

fp_chap1 = fopen (chap_chat_tmp_path, "w+");

if (fp_chap1 == null)

memset(readbuf,0,512);

fgets(readbuf,512,fp_chap);

while(!feof(fp_chap))

fprintf(fp_chap1,"%s",readbuf);

memset(readbuf,0,512);

fgets(readbuf,512,fp_chap);

}fclose(fp_chap);

fclose(fp_chap1);

if(unlink(chap_chat_path) !=0)

if( link(chap_chat_tmp_path,chap_chat_path) <0 )

if(unlink(chap_chat_tmp_path) !=0)

}}

一行一行分析JQ原始碼學習筆記 01

jquery function window,undefined undefined 防止外部引數中 var undefined 10 以此來改變內部 undefined 不太建議用嚴格模式 use strict 很多相容問題 瀏覽器假死狀態 rootjquery 類似jquery的根目錄 root...

批量刪除TXT檔案第一行和最後一行

終於實現了把python用起來,記錄一下,環境為python3.7,看了一些網上的方法,但這總算是乙個不錯的開端。import os import os.path import codecs 這裡放著你要操作的資料夾名稱 path c users rym desktop 金融 後復權 後復權a股全 ...

刪除檔案中的某一行以及檔案鎖

gpu.dat的內容如下 81e443bd b826 4459 999d 685fa63e8a88 dev dri renderd128 166a4eab fc0d 4264 a35d 8b78e09f22ea dev dri renderd128 56e846d8 b422 4720 b3e5 c...