Skip to content

Commit

Permalink
fix chmod bug (#337)
Browse files Browse the repository at this point in the history
The implementation of chmod was calculating the new permissions,
but then setting the permissions back to the old ones. This fixes
this bug.

Similarly, the value returned was the od value rather than the new one.
  • Loading branch information
atpotts authored and Gabriella439 committed Dec 10, 2018
1 parent f20d4e0 commit b678a50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Turtle/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1253,9 +1253,9 @@ chmod modifyPermissions path = liftIO (do
let permissions' = fromSystemDirectoryPermissions permissions
let permissions'' = modifyPermissions permissions'
changed = permissions' /= permissions''
let permissions''' = toSystemDirectoryPermissions permissions'
let permissions''' = toSystemDirectoryPermissions permissions''
when changed (Directory.setPermissions path' permissions''')
return permissions' )
return permissions'' )

-- | Get a file or directory's user permissions
getmod :: MonadIO io => FilePath -> io Permissions
Expand Down

0 comments on commit b678a50

Please sign in to comment.