on master help sign in
brushing up the manual of getFileInfo.
commitb61d75899499e222f03363151f5f2d2193465246 authorKazu Yamamoto <kazu@iij.ad.jp> dateThu 3 Dec 2015, 10:23 (11 years ago) parent0175a20
1 file changed+14−2
warp/Network/Wai/Handler/Warp.hs+14−2
warp/Network/Wai/Handler/Warp.hs+14−2
@@ -392,8 +392,20 @@ setHTTP2Disabled y = y { settingsHTTP2Enabled = False }
392392pauseTimeout :: Request -> IO ()
393393pauseTimeout = fromMaybe (return ()) . Vault.lookup pauseTimeoutKey . vault
394394
395−-- | Getting file information from the inside cache.
396−-- If file information is not available, an IO error is thrown.
395+-- | Getting file information of the target file.
396+--
397+-- This function first uses a stat(2) or similar system call
398+-- to obtain information of the target file, then registers
399+-- it into the internal cache.
400+-- From the next time, the information is obtained
401+-- from the cache. This reduces the overhead to call the system call.
402+-- The internal cache is refreshed every duration specified by
403+-- 'setFileInfoCacheDuration'.
404+--
405+-- This function throws an 'IO' exception if the information is not
406+-- available. For instance, the target file does not exist.
407+-- If this function is used an a Request generated by a WAI
408+-- backend besides Warp, it also throws an 'IO' exception.
397409--
398410-- Since 3.1.10
399411getFileInfo :: Request -> FilePath -> IO FileInfo