flock() 返回 TRUE 為成功;返回 FALSE 為失敗 (e.g. when a lock could not be acquired).
注意: 因為 flock() 需要一個檔案指標,you may have to use a special lock file to protect access to a file that you intend to truncate by opening it in write mode (with a "w" or "w+" argument to fopen()).