diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-06-30 17:43:28 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-06-30 21:46:19 +0200 |
commit | 234feea88c2edd6eac5199c1223dd10d09badbd4 (patch) | |
tree | e364c90f88f00eb747e17e19d41cea2bd82ac47b /src | |
parent | 47b8396c94af75832d96e4d3b4e0d7001ff70388 (diff) |
Windows support for filesystem storage
Diffstat (limited to 'src')
-rw-r--r-- | src/windows/Erebos/Storage/Platform.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/windows/Erebos/Storage/Platform.hs b/src/windows/Erebos/Storage/Platform.hs new file mode 100644 index 0000000..76c940b --- /dev/null +++ b/src/windows/Erebos/Storage/Platform.hs @@ -0,0 +1,13 @@ +module Erebos.Storage.Platform ( + createFileExclusive, +) where + +import Data.Bits + +import System.IO +import System.Win32.File +import System.Win32.Types + +createFileExclusive :: FilePath -> IO Handle +createFileExclusive path = do + hANDLEToHandle =<< createFile path gENERIC_WRITE (fILE_SHARE_READ .|. fILE_SHARE_DELETE) Nothing cREATE_NEW fILE_ATTRIBUTE_NORMAL Nothing |