summaryrefslogtreecommitdiff
path: root/src/windows/Erebos/Storage/Platform.hs
blob: 76c940bee0faf113f50fed666a3cd1f625ead09b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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