- 修改 /etc/exports
/home *(rw,sync)
- May 02 Wed 2012 16:31
nfs mount
- Apr 17 Tue 2012 15:41
取得相對路徑的絕對路徑
ln -s 在使用時最好使用絕對路徑,而剛好我在寫一個範例是使用相對路徑,找了好久才找到用法,其實也很簡單的。先用 cd 切換到該目錄,再用 pwd 取得該目錄的字串。
ln -s `cd test1/test;pwd` /usr/local/test
如果要在 script 中使用,則記得要先保留原始目錄,最後要記得切換回來,才不會造成不可遇期的問題喔。並不需要保留原始目錄。
- Apr 17 Tue 2012 14:03
在 makefile 判斷目錄是否存在
如果在 makefile 裏要建立一個新目錄,如果該目錄已經存在了,則會發生 mkdir: cannot create directory `test': File exists 的錯誤,並且會停止執行。但有時我們並不希望執行被中斷,所以就要先判斷目錄是否存在再建立。可以利用 wildcard 函數來判斷目錄是否存在。
OUTPUT_PATH := test
all:
ifeq "$(wildcard $(OUTPUT_PATH))" ""
mkdir $(OUTPUT_PATH)
echo "directory not existed"
else
echo "directory existed"
endif
另外還有一個更簡單的方法,就是直接下 make -p $(OUTPUT_PATH),-p 的用意就是當目錄存在時,不會產生錯誤。沒錯誤發生,當然執行不會被中斷囉。
- Apr 06 Fri 2012 15:56
free nfs server for windows
- Apr 03 Tue 2012 18:35
tmp 跟 ramfs 跟 tmpfs
程式語言 (6)