Win32-2.12.0.0: A binding to Windows Win32 API.
Copyright(c) Alastair Reid 1997-2003
LicenseBSD-style (see the file libraries/base/LICENSE)
MaintainerEsa Ilari Vuokko <ei@vuokko.info>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

System.Win32.File

Description

A collection of FFI declarations for interfacing with Win32.

Synopsis

Access modes

Sharing modes

Creation modes

File attributes and flags

Move file flags

File pointer directions

Drive types

Define DOS device flags

Binary types

File notification flags

File types

Lock modes

GetFileEx information levels

Security attributes

BY_HANDLE file information

Win32 file attribute data

Helpers

failIfWithRetry :: (a -> Bool) -> String -> IO a -> IO a Source #

like failIfFalse_, but retried on sharing violations. This is necessary for many file operations; see http://support.microsoft.com/kb/316609

failIfWithRetry_ :: (a -> Bool) -> String -> IO a -> IO () Source #

File operations

HANDLE operations

Reading/writing

Some operations below bear the win32_ prefix to avoid shadowing operations from Prelude.

File notifications

Directories

DOS device flags

File locks

lockFile Source #

Arguments

:: HANDLE

CreateFile handle

-> LockMode

Locking mode

-> DWORD64

Size of region to lock

-> DWORD64

Beginning offset of file to lock

-> IO BOOL

Indicates if locking was successful, if not query getLastError.

Locks a given range in a file handle, To lock an entire file use 0xFFFFFFFFFFFFFFFF for size and 0 for offset.

unlockFile Source #

Arguments

:: HANDLE

CreateFile handle

-> DWORD64

Size of region to unlock

-> DWORD64

Beginning offset of file to unlock

-> IO BOOL

Indicates if unlocking was successful, if not query getLastError.

Unlocks a given range in a file handle, To unlock an entire file use 0xFFFFFFFFFFFFFFFF for size and 0 for offset.