W3C home > Mailing lists > Public > public-expath@w3.org > January 2013

Re: Suggested addition to the File Module: file:temp-dir and file:temp-file

From: Matthias Brantner <matthias.brantner@28msec.com>
Date: Wed, 23 Jan 2013 15:04:35 -0800
Cc: public-expath@w3.org
Message-Id: <DF2C7E15-1092-4EE4-8AAC-7A624B3592F9@28msec.com>
To: Jostein Austvik Jacobsen <josteinaj@gmail.com>
Jostein

I think those functions are useful and I like the proposed changes.

Would you mind changing the returned value to be a file path instead of the absolute URI?
Otherwise, the return type should be xs:anyURI to be consistent with path-to-uri.
Also, we should consider renaming the functions to create-temp-* because the functions
actually create the files or directories, respectively.

What do you think?

Matthias

On Jan 23, 2013, at 6:55 AM, Jostein Austvik Jacobsen <josteinaj@gmail.com> wrote:

> The proposed EXProc File Utils steps[1] are pretty similar in functionality to the EXPath File Module. However, I think the EXPath File Module is missing one important thing; the ability to create temporary directories (and files). I'd like to use XPath rather than XProc for this. So how about something like:
> 
> 
> file:temp-dir($prefix as xs:string, $suffix as xs:string) as xs:string
> file:temp-dir($prefix as xs:string, $suffix as xs:string, $directory as xs:string) as xs:string
> 
> Creates a temporary directory. The temporary directory is guaranteed not to already exist when file:temp-dir is called.
> If the directory argument is not given, then the directory will be created inside the system-dependent default temporary-file directory.
> The operation will create all non-existing parent directories.
> The function returns the absolute URI of the temporary directory.
> 
> 
> file:temp-file($prefix as xs:string, $suffix as xs:string) as xs:string
> file:temp-file($prefix as xs:string, $suffix as xs:string, $directory as xs:string) as xs:string
> 
> Creates a temporary file. The temporary file is guaranteed not to already exist when file:temp-file is called.
> If the directory argument is not given, then the file will be created inside the system-dependent default temporary-file directory.
> The operation will create all non-existing parent directories.
> The function returns the absolute URI of the temporary file.
> 
> 
> [1] http://exproc.org/proposed/steps/fileutils.html#tempfile
> 
> Jostein
Received on Wednesday, 23 January 2013 23:05:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 23 January 2013 23:05:10 GMT