-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
102 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE QuasiQuotes #-} | ||
|
||
module Main where | ||
|
||
import Control.Concurrent | ||
import Control.Monad | ||
import System.File.OsPath | ||
import System.OsPath | ||
import System.IO.Temp | ||
|
||
import qualified Data.ByteString.Lazy as BL | ||
import qualified System.OsPath as OSP | ||
import qualified System.File.OsPath as OSP | ||
|
||
main :: IO () | ||
main = withSystemTempDirectory "test" $ \baseDir' -> do | ||
let fn = [osp|test.txt|] | ||
baseDir <- OSP.encodeFS baseDir' | ||
let fp = baseDir OSP.</> fn | ||
OSP.writeFile fp "" | ||
|
||
replicateM_ 100000 $ do | ||
thr <- forkIO (System.File.OsPath.readFile fp >>= BL.putStr) | ||
threadDelay 1 | ||
void $ killThread thr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters