From e6f0aac11f08ebc3a7e8e9b343b7c8b866cb2e25 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 13 May 2013 19:29:52 -0500 Subject: read inode cache file strictly to avoid failure to drop on windows Seems that Windows doesn't allow deleting a file that the same process has open. Here the inode cache file was read and a the value from it gets used later. But due to laziness, the old file is still open when it gets deleted. Adding strictness avoids this problem. Of course, the file is small, so it's no problem to read it all strictly, so this is probably an improvement even outside of Windows. --- Annex/Content/Direct.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 Annex/Content/Direct.hs (limited to 'Annex') diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs old mode 100644 new mode 100755 index 54befdf73..025ff60bf --- a/Annex/Content/Direct.hs +++ b/Annex/Content/Direct.hs @@ -110,7 +110,7 @@ goodContent key file = sameInodeCache file =<< recordedInodeCache key recordedInodeCache :: Key -> Annex [InodeCache] recordedInodeCache key = withInodeCacheFile key $ \f -> liftIO $ catchDefaultIO [] $ - mapMaybe readInodeCache . lines <$> readFile f + mapMaybe readInodeCache . lines <$> readFileStrict f {- Caches an inode for a file. - -- cgit v1.2.3