Cannot add a folder with HTML files as binaries that contain '[', ']', '{' or '}' in their file names
Monday, 2 February 2026 · 2 messages
J
joerg.hakenjos2 Feb 2026 16:33 #
Hi BaseX team!
When I try to add a HTML file that contains '[', ']', '{' or '}' in its file name (like "Test[].html") by selecting its parent folder, then I get an error message like this: Resource "C:\Program Files (x86)\BaseX\file:\C:\Test\Test[].html (The filename, directory name, or volume label syntax is incorrect)" not found.
It seems that in this case the current BaseX working directory is prefixed to the actual path. This happens when I set "Import format" to RAW or when I set "Import format" to anything but HTML and check "Add other files as binary files" in the GUI.
When I set "Import format" to HTML or XML then the file is added to the databse.
With the command line the behaviour is the same when trying to add Test[].html in C:\Test\:
BaseX 12.2 [Standalone]
Try 'help' to get more information.
Quoted text · 1 line
> CREATE DB Test
Database 'Test' created in 10.91 ms.
Quoted text · 1 line
> OPEN Test
Database 'Test' was opened in 0.02 ms.
Quoted text · 1 line
> SET PARSER raw
PARSER: rawQuoted text · 1 line
> SET CREATEFILTER *
CREATEFILTER: *Quoted text · 1 line
> ADD "C:\Test\"
Resource "C:\Program Files (x86)\BaseX\bin\file:\C:\Test\Test[].html (The filename, directory name, or volume label syntax is incorrect)" not found. !--- Manually renamed Test[].html to Test.html ---!
Quoted text · 1 line
> ADD "C:\Test\"
Resource(s) added in 2.6 ms.
I assume that !#$%&'()+-=@[]^_{}~ are valid characters for file names in BaseX. Am I getting something wrong or might this be a bug? I used the BaseX122.exe installer on Windows 11. BaseX119 and BaseX123-20260129.122524 behave the same.
CG
Christian Grün2 Feb 2026 17:18 #
Hi Jörg,
I agree, the error is unexpected. As you have already noticed, it only occurred when using the RAW parser, in which case the conversion of the input path failed. A new snapshot with a bug fix is available [1].
Best,
Christian
[1] https://files.basex.org/releases/latest/
Quoted text · joerg.hakenjos · 28 lines
Von: joerg.hakenjos--- via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> Gesendet: Montag, 2. Februar 2026 16:33 An: basex-talk at mailman.uni-konstanz.de <basex-talk at mailman.uni-konstanz.de> Betreff: [basex-talk] Cannot add a folder with HTML files as binaries that contain '[', ']', '{' or '}' in their file names Hi BaseX team! When I try to add a HTML file that contains '[', ']', '{' or '}' in its file name (like "Test[].html") by selecting its parent folder, then I get an error message like this: Resource "C:\Program Files (x86)\BaseX\file:\C:\Test\Test[].html (The filename, directory name, or volume label syntax is incorrect)" not found. It seems that in this case the current BaseX working directory is prefixed to the actual path. This happens when I set "Import format" to RAW or when I set "Import format" to anything but HTML and check "Add other files as binary files" in the GUI. When I set "Import format" to HTML or XML then the file is added to the databse. With the command line the behaviour is the same when trying to add Test[].html in C:\Test\: BaseX 12.2 [Standalone] Try 'help' to get more information. > CREATE DB Test Database 'Test' created in 10.91 ms. > OPEN Test Database 'Test' was opened in 0.02 ms. > SET PARSER raw PARSER: raw > SET CREATEFILTER * CREATEFILTER: * > ADD "C:\Test\" Resource "C:\Program Files (x86)\BaseX\bin\file:\C:\Test\Test[].html (The filename, directory name, or volume label syntax is incorrect)" not found. !--- Manually renamed Test[].html to Test.html ---! > ADD "C:\Test\" Resource(s) added in 2.6 ms. I assume that !#$%&'()+-=@[]^_{}~ are valid characters for file names in BaseX. Am I getting something wrong or might this be a bug? I used the BaseX122.exe installer on Windows 11. BaseX119 and BaseX123-20260129.122524 behave the same.
Written for BaseX 12.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery