darcs patch: System.Posix.Temp: improve haddocks for ... (and 2 more)

Mon Jan 18 19:27:55 EST 2010 gwern0@gmail.com * System.Posix.Temp: improve haddocks for mkstemp to explain what that returned String actually is Mon Jan 18 19:30:22 EST 2010 gwern0@gmail.com * System.Posix.Temp: pad input filenames with 6 Xs If the argument doesn't terminate in capital Xs, the C mkstemp will simply bomb out with zero warning. This was not documented. By arbitrarily sticking a bunch of Xes at the end of all arguments, we guarantee that this exception will not be thrown, the type signature will not change, and no existing code can break (since if it was manually avoiding the exception by adding "XXX" itself, the temp files will now be simply 3 random characters longer, nothing worse). Mon Jan 18 19:34:37 EST 2010 gwern0@gmail.com * System.Posix.Temp: rm whitespace

On Mon, Jan 18, 2010 at 7:35 PM,
Mon Jan 18 19:27:55 EST 2010 gwern0@gmail.com * System.Posix.Temp: improve haddocks for mkstemp to explain what that returned String actually is
Mon Jan 18 19:30:22 EST 2010 gwern0@gmail.com * System.Posix.Temp: pad input filenames with 6 Xs If the argument doesn't terminate in capital Xs, the C mkstemp will simply bomb out with zero warning. This was not documented. By arbitrarily sticking a bunch of Xes at the end of all arguments, we guarantee that this exception will not be thrown, the type signature will not change, and no existing code can break (since if it was manually avoiding the exception by adding "XXX" itself, the temp files will now be simply 3 random characters longer, nothing worse).
Mon Jan 18 19:34:37 EST 2010 gwern0@gmail.com * System.Posix.Temp: rm whitespace
Any thoughts by anyone? The changes seem straightforward enough to me that I'd rather not file bugs (if Trac is even working again). -- gwern

On 19/01/2010 00:35, gwern0@gmail.com wrote:
Mon Jan 18 19:27:55 EST 2010 gwern0@gmail.com * System.Posix.Temp: improve haddocks for mkstemp to explain what that returned String actually is
Mon Jan 18 19:30:22 EST 2010 gwern0@gmail.com * System.Posix.Temp: pad input filenames with 6 Xs If the argument doesn't terminate in capital Xs, the C mkstemp will simply bomb out with zero warning. This was not documented. By arbitrarily sticking a bunch of Xes at the end of all arguments, we guarantee that this exception will not be thrown, the type signature will not change, and no existing code can break (since if it was manually avoiding the exception by adding "XXX" itself, the temp files will now be simply 3 random characters longer, nothing worse).
Mon Jan 18 19:34:37 EST 2010 gwern0@gmail.com * System.Posix.Temp: rm whitespace
I'll validate and apply; thanks. Simon
participants (3)
-
Gwern Branwen
-
gwern0@gmail.com
-
Simon Marlow