PROPOSAL: Add openFileTemplate, openBinaryFileTemplate to System.IO

Ian Lynagh igloo at
Sat Jul 25 08:35:33 EDT 2009

On Fri, Jul 24, 2009 at 11:11:40PM -0700, Evan Laforge wrote:
> On Fri, Jul 24, 2009 at 11:02 PM, minh thu<noteed at> wrote:
> > 2009/7/25 Evan Laforge <qdunkan at>:
> >> I've never heard this usage of the word "template" before, so I
> >> guessed it was meant to open some kind of template file.
> >> openWithMode?  openWithPermissions?
> >
> > man mktemp
> Ohhh, it's for the filename, sorry, all the talk about permissions got
> me on the wrong track.

Right. Just to clarify for anyone else reading, we currently have:
    openTempFile           :: FilePath -> String -> IO (FilePath, Handle)
    openBinaryTempFile     :: FilePath -> String -> IO (FilePath, Handle)
which mask the mode, and we would add
    openFileTemplate       :: FilePath -> String -> IO (FilePath, Handle)
    openBinaryFileTemplate :: FilePath -> String -> IO (FilePath, Handle)
which do not.

Theese functions are used like this:
    openFileTemplate "/foo/bar" "bazXXX.ext"
and open a file called "baz143.ext". "bazXXX.ext" is the template.


More information about the Libraries mailing list