如何在不使用 Linux 中的標準 C 庫函式的情況下復制檔案?換句話說,我想直接用系統呼叫復制一個檔案。是否可以?
uj5u.com熱心網友回復:
直接用系統呼叫檔案。是否可以?
在偽代碼中,使用sendfile:
int in = open("input", ...);
fstatat(in, &stat);
int out = open("output", ...);
sendfile(in, out, NULL, stat.st_size);
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/388688.html
上一篇:在每次登錄到shell時列印會話上最后10個命令的歷史記錄
下一篇:POSIX替代inotify?
