restart UI

Browser behavior is not ideal; a new tab is opened on restart.
Browsers won't let me redirect to a file:// so I cannot use the old tab.
This commit is contained in:
Joey Hess 2013-01-03 18:50:30 -04:00
parent e09b7198d4
commit bad9b6761d
9 changed files with 56 additions and 34 deletions

View file

@ -101,3 +101,12 @@ isSticky = checkMode stickyMode
setSticky :: FilePath -> IO ()
setSticky f = modifyFileMode f $ addModes [stickyMode]
{- Writes a file, ensuring that its modes do not allow it to be read
- by anyone other than the current user, before any content is written. -}
writeFileProtected :: FilePath -> String -> IO ()
writeFileProtected file content = do
h <- openFile file WriteMode
modifyFileMode file $ removeModes [groupReadMode, otherReadMode]
hPutStr h content
hClose h