summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Ospald <hasufell@posteo.de>2021-06-14 21:16:57 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-02 04:12:41 -0400
commit2114a8ac26c303137931ad400b952afd131b691d (patch)
treefe783f871d5171aea39cec083b84c431dc8c3d49
parenta4ca6caaa2f61d1ef62db824dd2116b753cf24ee (diff)
downloadhaskell-2114a8ac26c303137931ad400b952afd131b691d.tar.gz
Improve documentation of openTempFile args
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettempfilenamew Specifically: > The null-terminated prefix string. The function uses up to the first > three characters of this string as the prefix of the file name. This > string must consist of characters in the OEM-defined character set.
-rw-r--r--libraries/base/System/IO.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/libraries/base/System/IO.hs b/libraries/base/System/IO.hs
index 59390c7ab4..864037d268 100644
--- a/libraries/base/System/IO.hs
+++ b/libraries/base/System/IO.hs
@@ -475,7 +475,9 @@ openTempFile :: FilePath -- ^ Directory in which to create the file
-> String -- ^ File name template. If the template is \"foo.ext\" then
-- the created file will be \"fooXXX.ext\" where XXX is some
-- random number. Note that this should not contain any path
- -- separator characters.
+ -- separator characters. On Windows, the template prefix may
+ -- be trunacted to 3 chars, e.g. \"foobar.ext\" will be
+ -- \"fooXXX.ext\".
-> IO (FilePath, Handle)
openTempFile tmp_dir template
= openTempFile' "openTempFile" tmp_dir template False 0o600