Directory and files are neither a file or a directory on Basex 9.3.2 when read from Docker volume
Hi, Here is my issue. I create a new container with Basex 9.3.2 I add a volume ContentDBs under my basex directory ContentDBs has 2 directories and 1 files I run this code from an xqm: let $src-dir-items := file:list('ContentDBs') let $debug := file:append('debug-a.xml', 'count: ' || count($src-dir-items) || ' ') let $dirs := for $i in $src-dir-items (: Bug items are neither a dir or a file !? Because volume from docker? :) let $debug := file:append('debug-a.xml', 'item: ' || $i || ' is dir: ' || file:is-dir($i) || ' ') let $debug := file:append('debug-a.xml', 'item: ' || $i || ' is file: ' || file:is-file($i) || ' ') return $i In the debug file, I get. - The count for items is 3 - For all items, is-dir and is-file are false. I get a similar error if I try to db:create from one of the folders, it seems to recognize that I have a folder, but it chokes on subfolders with: Resource 'js/' does not exist. -- France Baril Architecte documentaire / Documentation architect france.baril@architextus.com
Hi France, Does your code work without Docker?
let $src-dir-items := file:list('ContentDBs') ... let $debug := file:append('debug-a.xml', 'item: ' || $i || ' is dir: ' || file:is-dir($i) || ' ') let $debug := file:append('debug-a.xml', 'item: ' || $i || ' is file: ' || file:is-file($i) || ' ') return $i
Please note that file:list only returns the name of the files, not the paths. You can try file:children instead [1]. Hope this helps, Christian [1] https://docs.basex.org/wiki/File_Module#file:children
Ah! This resolved that! Thanks! On Mon, May 11, 2020 at 8:29 AM Christian Grün <christian.gruen@gmail.com> wrote:
Hi France,
Does your code work without Docker?
let $src-dir-items := file:list('ContentDBs') ... let $debug := file:append('debug-a.xml', 'item: ' || $i || ' is dir: ' || file:is-dir($i) || ' ') let $debug := file:append('debug-a.xml', 'item: ' || $i || ' is file: ' || file:is-file($i) || ' ') return $i
Please note that file:list only returns the name of the files, not the paths. You can try file:children instead [1].
Hope this helps, Christian
-- France Baril Architecte documentaire / Documentation architect france.baril@architextus.com
participants (2)
-
Christian Grün -
France Baril