Updated touch
to also create the file if missing
This commit is contained in:
parent
57054122d3
commit
5e2d77f65f
1 changed files with 5 additions and 1 deletions
|
@ -276,7 +276,11 @@ testdir = Filesystem.isDirectory
|
|||
Creates the file if it does not exist
|
||||
-}
|
||||
touch :: FilePath -> IO ()
|
||||
touch file = touchFile (Filesystem.encodeString file)
|
||||
touch file = do
|
||||
exists <- testfile file
|
||||
if exists
|
||||
then touchFile (Filesystem.encodeString file)
|
||||
else sh (fileOut file empty)
|
||||
#endif
|
||||
|
||||
{-| Create a temporary directory underneath the given directory
|
||||
|
|
Loading…
Reference in a new issue