filemanip icon indicating copy to clipboard operation
filemanip copied to clipboard

ModifyInPlace ignores file permissions

Open rnhmjoj opened this issue 9 years ago • 1 comments

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

rnhmjoj avatar Sep 17 '15 19:09 rnhmjoj

I just ran into this. It's definitely a problem.

FranklinChen avatar Oct 20 '15 21:10 FranklinChen