projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0720957
)
Tweak temporary file filename chooser
author
Ian Lynagh
<igloo@earth.li>
Sun, 22 Jul 2007 10:54:45 +0000
(10:54 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Sun, 22 Jul 2007 10:54:45 +0000
(10:54 +0000)
System/IO.hs
patch
|
blob
|
history
diff --git
a/System/IO.hs
b/System/IO.hs
index
0d9d029
..
2970cf0
100644
(file)
--- a/
System/IO.hs
+++ b/
System/IO.hs
@@
-425,7
+425,12
@@
openTempFile' loc tmp_dir template binary = do
pid <- c_getpid
findTempName pid
where
pid <- c_getpid
findTempName pid
where
- (prefix,suffix) = break (=='.') template
+ -- We split off the last extension, so we can use .foo.ext files
+ -- for temporary files (hidden on Unix OSes). Unfortunately we're
+ -- below filepath in the hierarchy here.
+ (prefix,suffix) = case break (== '.') $ reverse template of
+ (rev_suffix, rev_prefix) ->
+ (reverse rev_prefix, reverse rev_suffix)
oflags1 = rw_flags .|. o_EXCL
oflags1 = rw_flags .|. o_EXCL