記得初中的時候用***看電子書,***支援的文字文件格式不能超過1m,否則打不開,然後在網上下了乙個檔案分割器,感覺真的很強大啊(別吐槽,當時真的很白)。
等自己學了c語言後,便想自己弄乙個檔案分割器,可是在網上搜了一下原始碼,看起來很複雜的樣子,也就沒了興趣。現在又重新拾起了這個願望,不過第一次弄的比較簡單,沒有重新命名等功能,以後還會重新附加功能的。
有什麼不足的,歡迎拍磚。
閒話少敘,直接上源**。
/* copy the file1 into 2 file --------
* file2 && file3
* and then print file2 && file3
*/#include #include int main(void)
if ( ( fp2 = fopen ("file2", "w+")) == null)
if ( ( fp3 = fopen ("file3", "w+")) == null)
//count the row of the file
while ((ch = fgetc (fp1)) != eof )
rewind(fp1);
//copy file1 into two files----file2 && file3
while ((ch = fgetc (fp1)) != eof)
if (copy_row_count > row_count/2)
} rewind(fp1);
rewind(fp2);
rewind(fp3);
printf("#########\nfile1:\n#########\n");
while ((ch = fgetc(fp1)) != eof )
putchar(ch);
printf("#########\nfile2:\n#########\n");
while ((ch = fgetc(fp2)) != eof )
putchar(ch);
printf("#########\nfile3:\n#########\n");
while ((ch = fgetc(fp3)) != eof )
putchar(ch);
fclose(fp1);
fclose(fp2);
fclose(fp3);
return 0;
}
檔案分割器
2000年11月17日 10 11 00 檔案分割器 李光強 檔案分割器是個比較實用的工具。當我們要從別的電腦拷貝乙個大於一張磁碟容量的檔案或時就可以體會到它的好處。檔案分割器的原理其實很簡單,大體是這樣 先把想要分割的檔案的大小讀出來,再用它去除每張磁碟的容量,得出所需的磁碟數,然後就開始讀取檔案...
檔案分割器
using system using system.collections.generic using system.componentmodel using system.data using system.drawing using system.text using system.window...
C 版檔案分割器
public 檔案分割器1 選擇要分割的檔案 private void btnfgwenjian click object sender,eventargs e catch 選擇要儲存的路徑,如果不選預設為與原檔案同路徑 private void btnfglujing click object s...