作者ilway25 (鍋燒手)
看板b96902HW
標題Re: [系程] 作業二
時間Tue Apr 28 12:23:51 2009
※ 引述《chienwen (健文)》之銘言:
: ※ 引述《wfuny (KuanYu)》之銘言:
: : 1.有可能出現直接file的Loop嗎
: : 如下
: : A->B
: : B->A
: 有可能。
: : 2.有可能要找的檔案名是被別人link到的,但不在原來path下的嗎??
: : 如下
: : HOME directory 下有 A
: : A--> apple_tomato (apple_tomato 不在 HOME directory)
: 有可能。
所以這種情況下,如果要找 apple,
我們「一定」要知道 A 是連到 apple_tomato 才能找得到,是這樣嗎?
是的話我就完全誤會了................
That is to say, if a file is a symbolic link, use the file
information of the referenced file instead of the link file
itself when implementing the function g.
所以這句話的 file information 是包含 filename 嗎?
我以為如果是 apple_size 連到 B,那麼要取得 B 的 size ...
: : 3.這次做業是要我們用stat嗎?? 還是要用readlink一直讀下去??
: 可以自行決定要用什麼函數完成要求
: 通常會用stat家族的函數
: 必要時可能會用到readlink
: 不可以用ftw、nftw、fts等現成的目錄traverse函數
: 謝謝:)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.245.11
※ 編輯: ilway25 來自: 140.112.245.11 (04/28 12:40)