PHP Conference Japan 2024

dio_read

(PHP 4 >= 4.2.0, PHP 5 < 5.1.0)

dio_read從檔案描述子讀取位元組

說明

dio_read(資源 $fd, int $len = 1024): 字串

函式 dio_read() 從描述子為 fd 的檔案中讀取並返回 len 個位元組。

參數

fd

dio_open() 返回的檔案描述子。

len

要讀取的位元組數。如果未指定,dio_read() 將讀取 1K 大小的區塊。

回傳值

fd 讀取的位元組。

參見

  • dio_write() - 將資料寫入 fd,並可選擇在指定長度截斷

新增註記

使用者貢獻的註記 1 則註記

matt at vhub dot com
18 年前
請注意,在 Windows 系統上(其他平台未知),如果沒有資料可供讀取,dio_read 將不會逾時。 在 Windows 上沒有辦法指定逾時或執行非阻塞讀取。
To Top