File Module

Dear all,

after more than two years, the EXPath File Module is about to be
finished. I have just put the latest versions of the spec online
(including the diff):

  http://files.basex.org/publications/expath.org/spec/file.html
  http://files.basex.org/publications/expath.org/spec/file-diff.html

Thanks to John Lumley, and other people on our own mailing list, who
have given us helpful feedback. Our plan was to avoid major changes to
the spec, due to its advanced state, but I think the feedback should
not be simply discarded:

1) The vintage Linux commands "dirname" and "basename" have also been
adopted to the spec, but it has turned out it’s not only the wording
that’s unfortunate (in most cases, dir-name() does not return a name,
but rather the path to a directory). We would thus like to drop these
two functions and instead introduce the following alternatives:

SIGNATURE
  file:parent($path as xs:string) as xs:string?
DESCRIPTION
  Returns the parent directory of a file or directory. – An empty
sequence is returned if the path points to a root directory, or if it
contains no directory separators. – This function is ·deterministic·
(no path existence check is made).

SIGNATURE
  file:name($path as xs:string) as xs:string
DESCRIPTION
  Returns the name of a file or directory. – An empty string is
returned if the path points to the root directory, or if it contains
no directory separators. – This function is ·deterministic· (no path
existence check is made).

2) Florent suggested to replace the existing error codes with his new
EXPath naming conventions:

  http://www.w3.org/community/expath/wiki/Naming

I first resisted, as the File Module is already used in the wild, but
if we decide to replace the functions mentioned above, it would be
just consequent to also make the codes more accessible.

If everyone agrees to the two changes, I will once more update the
spec and hope that we can release it as official EXPath Proposed
Module.

Thanks for your attention,
Christian

Received on Friday, 29 November 2013 15:56:49 UTC