I'm trying to use the CREATEFILTER directive to:
. Include all files WITHOUT an extension
. Exclude all files WITH an extension
. Exclude the specific file "_cache" (note, it has NO extension)
. Do all this for a whole directory tree
I notice that CREATEFILTER uses "glob syntax" (http://docs.basex.org/wiki/Commands#Glob_Syntax)
Questions:
1. Since this is a java program, does that mean that: http://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob and http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getPa thMatcher%28java.lang.String%29 provide the exact full description of "glob syntax" for BaseX?
2. If so, can I do what I want to do with some sort of a "!" (negation) pattern?
3. Should this work with version 6.3.5 of BaseX?
Thanks!
David
mailto:david@leighweb.com DavidEmailSig
Hi David,
the CREATEFILTER option can only be used to include files for parsing. To exclude files, the best alternative is to write a little XQuery and do some string matching by yourself, as e.g. shown in the following example:
let $root := "/path/to/files/" for $file in file:list($root, true()) where matches($file, "your pattern") return db:add("database", $root || $file, $file)
1. Since this is a java program, does that mean that:
..unfortunately, there is no standard glob parser in Java (in fact, most glob parsers have subtle differences and are often os-dependent).
3. Should this work with version 6.3.5 of BaseX?
I highly recommend to switch to our latest version, as we can't offer any support for older versions of BaseX (except for commercial customers).
Hope this helps, Christian
Thank you for the quick response as always. When I get around to actually getting into this (and upgrading to the current version), I'm sure I'll be back with some questions. It looks promising. David
-----Original Message----- From: Christian Grün [mailto:christian.gruen@gmail.com] Sent: Wednesday, April 11, 2012 05:31 PM To: david@leighweb.com Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] glob syntax
Hi David,
the CREATEFILTER option can only be used to include files for parsing. To exclude files, the best alternative is to write a little XQuery and do some string matching by yourself, as e.g. shown in the following example:
let $root := "/path/to/files/" for $file in file:list($root, true()) where matches($file, "your pattern") return db:add("database", $root || $file, $file)
1. Since this is a java program, does that mean that:
..unfortunately, there is no standard glob parser in Java (in fact, most glob parsers have subtle differences and are often os-dependent).
3. Should this work with version 6.3.5 of BaseX?
I highly recommend to switch to our latest version, as we can't offer any support for older versions of BaseX (except for commercial customers).
Hope this helps, Christian
basex-talk@mailman.uni-konstanz.de