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
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/ ___________________________
On Tue, Feb 12, 2013 at 11:07 AM, Hans-Juergen Rennau hrennau@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@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de