diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # Changelog for libyaml
 
+## 0.1.1.1
+
+* Work around GHC 8.6.5 issue on Windows preventing truncated files.  [#178](https://github.com/snoyberg/yaml/issues/178)
+
 ## 0.1.1.0
 
 * Add options to `FormatOptions` to govern when tags rendered explicitly and when they are left implicit. [#165](https://github.com/snoyberg/yaml/issues/165)
diff --git a/libyaml.cabal b/libyaml.cabal
--- a/libyaml.cabal
+++ b/libyaml.cabal
@@ -1,13 +1,13 @@
 cabal-version: 1.12
 
--- This file has been generated from package.yaml by hpack version 0.31.1.
+-- This file has been generated from package.yaml by hpack version 0.31.2.
 --
 -- see: https://github.com/sol/hpack
 --
--- hash: d20fe3a9f7ef759a6555e0219f0728d8a3d1f073384d6d705d588c1160f3743e
+-- hash: d35e8c4d317f96574fdc8b6a72f99c2244dacbb949ce1609e8dd56ddbe89a108
 
 name:           libyaml
-version:        0.1.1.0
+version:        0.1.1.1
 synopsis:       Low-level, streaming YAML interface.
 description:    README and API documentation are available at <https://www.stackage.org/package/libyaml>
 category:       Text
@@ -77,4 +77,6 @@
         yaml
   if os(windows)
     cpp-options: -DWINDOWS
+    build-depends:
+        directory
   default-language: Haskell2010
diff --git a/src/Text/Libyaml.hs b/src/Text/Libyaml.hs
--- a/src/Text/Libyaml.hs
+++ b/src/Text/Libyaml.hs
@@ -7,6 +7,7 @@
 {-# LANGUAGE RankNTypes #-}
 {-# LANGUAGE CPP #-}
 {-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 
 -- | Low-level, streaming YAML interface. For a higher-level interface, see
 -- "Data.Yaml".
@@ -69,6 +70,11 @@
 import qualified Data.ByteString.Internal as B
 import qualified Data.ByteString.Unsafe as BU
 
+#if WINDOWS && __GLASGOW_HASKELL__ >= 806
+import System.Directory (removeFile)
+import qualified Control.Exception
+#endif
+
 data Event =
       EventStreamStart
     | EventStreamEnd
@@ -788,6 +794,11 @@
     bracketP getFile c_fclose $ \file -> runEmitter opts (alloc file) (\u _ -> return u)
   where
     getFile = do
+#if WINDOWS && __GLASGOW_HASKELL__ >= 806
+        -- See: https://github.com/snoyberg/yaml/issues/178#issuecomment-550180027
+        removeFile filePath `Control.Exception.catch`
+          (\(_ :: Control.Exception.IOException) -> pure ())
+#endif
         file <- openFile filePath write_flags "w"
         if file == nullPtr
             then throwIO $ YamlException $ "could not open file for write: " ++ filePath
