file:list - returns no directories

Tuesday, 12 February 2013 · 2 messages · last reply 13 Feb 2013
HR
Hans-Juergen Rennau12 Feb 2013 11:07 #
Dear BaseX team, the documentation states: "Lists all files and directories found in the specified $dir."; however the function does not always return file names.
(1) If parameter $recursive=true, the contents are returned, but not the directories themselves.
(2) The call "file:list($dir, false(), '*') does not return directories
In case of (1), this behavior may often be desirable, but sometimes not, namely if I want to construct a directory tree. Perhaps a further control option would be worth considering? I am not sure. At any rate, if the present behavior is intended, the documentation should be adapted. (2) seems to me a bug, as the call should be equivalent to a one-parameter call, shouldn't it? With kind regards, Hans-Juergen
CG
Christian Grün13 Feb 2013 13:44 #
Dear Hans-Jürgen, true, the existing implementation didn’t fully conform to our own spec, which states that all files and directories are returned, no matter which arguments are specified. Instead, directories were ignored as soon as a pattern was specified. This is now fixed in the latest stable snashot [1]. Thanks for your observation, Christian [1] http://files.basex.org/releases/latest/
Quoted text · Hans-Juergen Rennau · 21 lines
On Tue, Feb 12, 2013 at 11:07 AM, Hans-Juergen Rennau <hrennau at yahoo.de> wrote: > > Dear BaseX team, > > the documentation states: "Lists all files and directories found in the specified $dir."; however the function does not always return file names. > > (1) If parameter $recursive=true, the contents are returned, but not the directories themselves. > (2) The call "file:list($dir, false(), '*') does not return directories > > In case of (1), this behavior may often be desirable, but sometimes not, namely if I want to construct a directory tree. Perhaps a further control option would be worth considering? I am not sure. At any rate, if the present behavior is intended, the documentation should be adapted. > > (2) seems to me a bug, as the call should be equivalent to a one-parameter call, shouldn't it? > > With kind regards, > Hans-Juergen > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >

⚡Generated with XQuery