filemanip
filemanip copied to clipboard
ModifyInPlace ignores file permissions
After being edited with ModifyInPlace
files become read only.
~ λ mkdir test; cd test
~/test λ touch example
~/test λ ls -l
-rw-r--r-- 1 rnhmjoj users 0 Sep 17 21:18 example
~/test λ nix-shell -p 'haskellPackages.ghcWithPackages (hs: [hs.filemanip])'
[nix-shell:~/test]$ ghci
GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help
Prelude> import System.FilePath.Manip
Prelude System.FilePath.Manip> modifyInPlace (unlines . lines) "example"
Prelude System.FilePath.Manip>
Leaving GHCi.
[nix-shell:~/test]$ ls -l
total 0
-r-------- 1 rnhmjoj users 0 Sep 17 21:21 example
I just ran into this. It's definitely a problem.