file:list() vs. file:children() and symlinks in BaseX 13
Consider the following (Linux) directory structure, where /tmp/foo/baz is a symbolic link to the directory /tmp/foo/bar:
/tmp/foo /tmp/foo/bar /tmp/foo/bar/spam /tmp/foo/bar/ham /tmp/foo/bar/egg /tmp/foo/baz -> /tmp/foo/bar
On BaseX 12.4, both file:list('/tmp/foo/baz') and file:children('/tmp/foo/baz') follow the symlink, and return ('spam', 'ham', 'egg') and ('/tmp/foo/baz/spam', '/tmp/foo/baz/ham', '/tmp/foo/baz/egg') respectively.
On the latest BaseX 13 build as of this writing (BaseX130-20261028.185708.zip), file:list() still behaves the same way, but file:children() raises:
[file:no-dir] '/tmp/foo/baz' is no directory.
Is this change intentional?
Hi Peter,
A clear regression, caused by a recent optimization to speed up descendant file traversals. Thanks for letting us know; a fix is available [1].
Best, Christian
Quoted text · Peter Piwowarski · 17 lines
Peter Piwowarski via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> schrieb am Mittwoch, 28. Oktober 2026 um 22:06: > Consider the following (Linux) directory structure, where /tmp/foo/baz is a symbolic link to the directory /tmp/foo/bar: > > /tmp/foo > /tmp/foo/bar > /tmp/foo/bar/spam > /tmp/foo/bar/ham > /tmp/foo/bar/egg > /tmp/foo/baz -> /tmp/foo/bar > > On BaseX 12.4, both file:list('/tmp/foo/baz') and file:children('/tmp/foo/baz') follow the symlink, and return ('spam', 'ham', 'egg') and ('/tmp/foo/baz/spam', '/tmp/foo/baz/ham', '/tmp/foo/baz/egg') respectively. > > On the latest BaseX 13 build as of this writing (BaseX130-20261028.185708.zip), file:list() still behaves the same way, but file:children() raises: > > [file:no-dir] '/tmp/foo/baz' is no directory. > > Is this change intentional?
Confirmed fixed in BaseX130-20261029.164635.zip <https://files.basex.org/releases/latest/BaseX130-20261029.164635.zip>, thanks!
Quoted text · Christian Grün · 38 lines
Christian Grün wrote: > Hi Peter, > > A clear regression, caused by a recent optimization to speed up > descendant file traversals. Thanks for letting us know; a fix is > available [1]. > > Best, > Christian > > [1] https://files.basex.org/releases/latest/ > ____________________________________ > > Peter Piwowarski via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> > schrieb am Mittwoch, 28. Oktober 2026 um 22:06: >> Consider the following (Linux) directory structure, where >> /tmp/foo/baz is a symbolic link to the directory /tmp/foo/bar: >> >> /tmp/foo >> /tmp/foo/bar >> /tmp/foo/bar/spam >> /tmp/foo/bar/ham >> /tmp/foo/bar/egg >> /tmp/foo/baz -> /tmp/foo/bar >> >> On BaseX 12.4, both file:list('/tmp/foo/baz') and >> file:children('/tmp/foo/baz') follow the symlink, and return ('spam', >> 'ham', 'egg') and ('/tmp/foo/baz/spam', '/tmp/foo/baz/ham', >> '/tmp/foo/baz/egg') respectively. >> >> On the latest BaseX 13 build as of this writing >> (BaseX130-20261028.185708.zip), file:list() still behaves the same >> way, but file:children() raises: >> >> [file:no-dir] '/tmp/foo/baz' is no directory. >> >> Is this change intentional? >
Written for BaseX 12.4. BaseX may have changed since: please check the current documentation.